7.1.4. cobbler.cobblerd package

7.1.4.1. Submodules

7.1.4.2. cobbler.cobblerd.cli module

Module for the CLI logic of the Cobbler backend.

cobbler.cobblerd.cli.cli_generate_main_parser() ArgumentParser[source]

Generates the main CLI parser for the Cobbler daemon.

cobbler.cobblerd.cli.cli_generate_setup_parser(parent_parser: argparse._SubParsersAction[argparse.ArgumentParser]) None[source]

Generates the setup parser.

7.1.4.3. cobbler.cobblerd.daemon module

Cobbler daemon for logging remote syslog traffic during automatic installation

cobbler.cobblerd.daemon.core(cobbler_api: CobblerAPI) None[source]

Starts Cobbler.

Parameters:

cobbler_api – The cobbler_api instance which is used for this method.

cobbler.cobblerd.daemon.daemonize_self() None[source]

Deamonizes the current process.

cobbler.cobblerd.daemon.do_xmlrpc_rw(cobbler_api: CobblerAPI, port: int) None[source]

This trys to bring up the Cobbler xmlrpc_api and restart it if it fails.

Parameters:
  • cobbler_api – The cobbler_api instance which is used for this method.

  • port – The port where the xmlrpc api should run on.

cobbler.cobblerd.daemon.regen_ss_file() None[source]

This is only used for Kerberos auth at the moment. It identifies XMLRPC requests from Apache that have already been cleared by Kerberos.

7.1.4.4. cobbler.cobblerd.distro_options module

Module to provide reasonable defaults to the cobblerd setup utility.

class cobbler.cobblerd.distro_options.DistroOptions(datapath: Path = PosixPath('/usr/share/cobbler'), docpath: Path = PosixPath('/usr/share/man'), etcpath: Path = PosixPath('/etc/cobbler'), libpath: Path = PosixPath('/var/lib/cobbler'), logpath: Path = PosixPath('/var/log'), systemd_dir: Path = PosixPath('/etc/systemd/system'), completion_path: Path = PosixPath('/usr/share/bash-completion/completions'), httpd_user: str = 'apache', httpd_group: str = 'apache', httpd_service: str = 'apache2.service', webroot: Path = PosixPath('/srv/www'), webconfig: Path = PosixPath('/etc/apache2/vhosts.d'), webrootconfig: Path = PosixPath('/etc/apache2'), tftproot: Path = PosixPath('/srv/tftpboot'), bind_zonefiles: Path = PosixPath('/var/lib/named'), defaultpath: Path = PosixPath('etc/sysconfig'), shim_folder: str = '/usr/share/efi/*/', shim_file: str = 'shim\\.efi', secure_grub_folder: str = '/usr/share/efi/*/', secure_grub_file: str = 'grub\\.efi', ipxe_folder: Path = PosixPath('/usr/share/ipxe'), pxelinux_folder: Path = PosixPath('/usr/share/syslinux'), memdisk_folder: Path = PosixPath('/usr/share/syslinux'), syslinux_dir: Path = PosixPath('/usr/share/syslinux'), grub_mod_folder: Path = PosixPath('/usr/share/grub2'))[source]

Bases: object

This class sets up configuration options based on the detected Linux distribution.

bind_zonefiles: Path = PosixPath('/var/lib/named')
completion_path: Path = PosixPath('/usr/share/bash-completion/completions')
datapath: Path = PosixPath('/usr/share/cobbler')
defaultpath: Path = PosixPath('etc/sysconfig')
docpath: Path = PosixPath('/usr/share/man')
etcpath: Path = PosixPath('/etc/cobbler')
grub_mod_folder: Path = PosixPath('/usr/share/grub2')
httpd_group: str = 'apache'

Group which is used to execute apache2.

httpd_service: str = 'apache2.service'
httpd_user: str = 'apache'

User which is used to execute apache2.

ipxe_folder: Path = PosixPath('/usr/share/ipxe')
libpath: Path = PosixPath('/var/lib/cobbler')
logpath: Path = PosixPath('/var/log')
memdisk_folder: Path = PosixPath('/usr/share/syslinux')
pxelinux_folder: Path = PosixPath('/usr/share/syslinux')
secure_grub_file: str = 'grub\\.efi'
secure_grub_folder: str = '/usr/share/efi/*/'
shim_file: str = 'shim\\.efi'
shim_folder: str = '/usr/share/efi/*/'
syslinux_dir: Path = PosixPath('/usr/share/syslinux')
systemd_dir: Path = PosixPath('/etc/systemd/system')
tftproot: Path = PosixPath('/srv/tftpboot')

Directory which the TFTP server is offering.

to_context() Dict[str, str][source]

This creates a context dictionary that can be used to template a given file.

webconfig: Path = PosixPath('/etc/apache2/vhosts.d')
webroot: Path = PosixPath('/srv/www')

Directory where Cobbler can create the directory which the webserver can serve.

webrootconfig: Path = PosixPath('/etc/apache2')
cobbler.cobblerd.distro_options.get_distro_options() DistroOptions[source]

Detects the Linux distribution and sets up environment variables accordingly. Returns an instance of DistroOptions with the appropriate settings.

7.1.4.5. cobbler.cobblerd.setup module

Module for setting up Cobbler daemon configuration files, directories, and templates.

This module provides functions to copy resource files, template configuration files, and create required directory structures for Cobbler’s operation. It supports setup for Apache, Nginx, systemd, logrotate, manpages, and other components based on distribution options and installation scope.

cobbler.cobblerd.setup.copy_directory(src: Traversable, dst: Path) None[source]

Copies a directory from the resource files to the destination path.

Parameters:
  • src – The source directory in the resource files.

  • dst – The destination path where the directory should be copied.

cobbler.cobblerd.setup.copy_file(src: Traversable, dst: Path) None[source]

Copies a file from the resource files to the destination path.

Parameters:
  • src – The source file in the resource files.

  • dst – The destination path where the file should be copied.

cobbler.cobblerd.setup.get_path_no_root(path: Path) Path[source]

Strip the leading slash in case one exists.

cobbler.cobblerd.setup.get_prefixed_path(path: Path, prefix: Path) Path[source]

Prefix the given path with a prefix.

cobbler.cobblerd.setup.setup_cobblerd(base_path: Path, distro_options: DistroOptions, scope: List[str]) None[source]

Setup all required directories and files for the Cobbler daemon.

cobbler.cobblerd.setup.setup_cobblerd_apache(base_path: Path, resource_files: Traversable) None[source]

Use the embedded Apache configuration and install it into the system.

cobbler.cobblerd.setup.setup_cobblerd_log_directories(base_path: Path, apache_user: str) None[source]

Create all the directories needed for logging in the Cobbler daemon.

cobbler.cobblerd.setup.setup_cobblerd_logrotate(base_path: Path, resource_files: Traversable) None[source]

Use the embedded logrotate configuration and install it into the system.

cobbler.cobblerd.setup.setup_cobblerd_manpages(base_path: Path, resource_files: Traversable) None[source]

Use the embedded manpages and install them into the system.

cobbler.cobblerd.setup.setup_cobblerd_nginx(base_path: Path, resource_files: Traversable) None[source]

Use the embedded Nginx configuration and install it into the system.

cobbler.cobblerd.setup.setup_cobblerd_systemd(base_path: Path, resource_files: Traversable) None[source]

Use the embedded systemd service file and install it into the system.

cobbler.cobblerd.setup.template_file(path: Path, context: DistroOptions)[source]

This method takes a file and templates it with the magic “@@name@@” syntax.

7.1.4.6. Module contents

Cobbler daemon for logging remote syslog traffic during automatic installation

cobbler.cobblerd.main() int[source]

Main entrypoint for the Cobbler daemon.