7.1.7.1.4. cobbler.modules.managers package
7.1.7.1.4.1. Submodules
7.1.7.1.4.2. cobbler.modules.managers.bind module
This is some of the code behind ‘cobbler sync’.
- class cobbler.modules.managers.bind.MetadataZoneHelper(forward_zones: List[str], reverse_zones: List[Tuple[str, str]], zone_include: str)[source]
Bases:
objectHelper class to hold data for template rendering of named config files.
- cobbler.modules.managers.bind.get_manager(api: CobblerAPI) _BindManager[source]
This returns the object to manage a BIND server located locally on the Cobbler server.
- Parameters:
api – The API to resolve all information with.
- Returns:
The BindManger object to manage bind with.
7.1.7.1.4.3. cobbler.modules.managers.dnsmasq module
This is some of the code behind ‘cobbler sync’.
- cobbler.modules.managers.dnsmasq.get_manager(api: CobblerAPI) _DnsmasqManager[source]
Creates a manager object to manage a dnsmasq server.
- Parameters:
api – The API to resolve all information with.
- Returns:
The object generated from the class.
7.1.7.1.4.4. cobbler.modules.managers.dynamic_httpd module
This is some of the code behind ‘cobbler sync’ for the dynamic HTTP-serving mode, where the distro source tree is served on demand (e.g. straight from its original location) instead of being copied into the webroot.
Unlike dynamic_tftp.py, which changes behavior itself by turning all its methods into no-ops, this module does
not change any sync-time behavior on its own. It is inert; it only exists to be selectable, so a later task’s
cobbler import logic can check
api.get_module_name_from_file("httpd", "module", "managers.in_httpd") == "managers.dynamic_httpd" and decide to
skip copying the distro tree, and so cobbler check can warn about stale source paths.
- cobbler.modules.managers.dynamic_httpd.get_manager(api: CobblerAPI) _DynamicHttpdManager[source]
Creates a manager object to manage HTTP content that is served dynamically instead of being copied into the webroot.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.5. cobbler.modules.managers.dynamic_tftp module
This is some of the code behind ‘cobbler sync’ when TFTP content is served dynamically (e.g. by the separate cobbler-tftp daemon) instead of being materialized into the TFTP root directory.
- cobbler.modules.managers.dynamic_tftp.get_manager(api: CobblerAPI) _DynamicTftpManager[source]
Creates a manager object to manage TFTP content that is served dynamically instead of being copied into the TFTP root.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.6. cobbler.modules.managers.genders module
Cobbler Module that manages the cluster configuration tool from CHAOS. For more information please see: GitHub - chaos/genders
- cobbler.modules.managers.genders.register() str[source]
We should run anytime something inside of Cobbler changes.
- Returns:
Always
/var/lib/cobbler/triggers/change/*
- cobbler.modules.managers.genders.run(api: CobblerAPI, args: Any) int[source]
Mandatory Cobbler trigger hook.
- Parameters:
api – The api to resolve information with.
args – For this implementation unused.
- Returns:
0or1, depending on the outcome of the operation.
- cobbler.modules.managers.genders.write_genders_file(config: CobblerAPI, profiles_genders: Dict[str, str], distros_genders: Dict[str, str], mgmtcls_genders: Dict[str, str])[source]
Genders file is over-written when
manage_gendersis set in our settings.- Parameters:
config – The API instance to template the data with.
profiles_genders – The profiles which should be included.
distros_genders – The distros which should be included.
mgmtcls_genders – The management classes which should be included.
- Raises:
OSError – Raised in case the template could not be read.
7.1.7.1.4.7. cobbler.modules.managers.import_signatures module
7.1.7.1.4.8. cobbler.modules.managers.in_httpd module
This is some of the code behind ‘cobbler sync’ for the default HTTP-serving mode, where the distro source tree is
copied into the webroot (e.g. /var/www/cobbler/distro_mirror) so it can be served by the system HTTP server.
- cobbler.modules.managers.in_httpd.get_manager(api: CobblerAPI) _InHttpdManager[source]
Creates a manager object to manage an in_httpd server.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.9. cobbler.modules.managers.in_tftpd module
This is some of the code behind ‘cobbler sync’.
- cobbler.modules.managers.in_tftpd.get_manager(api: CobblerAPI) _InTftpdManager[source]
Creates a manager object to manage an in_tftp server.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.10. cobbler.modules.managers.isc module
This is some of the code behind ‘cobbler sync’.
- cobbler.modules.managers.isc.get_manager(api: CobblerAPI) _IscManager[source]
Creates a manager object to manage an isc dhcp server.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.11. cobbler.modules.managers.ndjbdns module
This is some of the code behind ‘cobbler sync’.
- cobbler.modules.managers.ndjbdns.get_manager(api: CobblerAPI) _NDjbDnsManager[source]
Creates a manager object to manage an isc dhcp server.
- Parameters:
api – The API which holds all information in the current Cobbler instance.
- Returns:
The object to manage the server with.
7.1.7.1.4.12. Module contents
This module contains extensions for services Cobbler is managing. The services are restarted via the service command
or alternatively through the server executables directly. Cobbler does not announce the restarts but is expecting to be
allowed to do this on its own at any given time. Thus all services managed by Cobbler should not be touched by any
other tool or administrator.
- class cobbler.modules.managers.DhcpManagerModule(api: CobblerAPI)[source]
Bases:
ManagerModuleAbstract base class for DHCP manager modules.
Defines the interface for DHCP-specific service management in Cobbler.
- class cobbler.modules.managers.DnsManagerModule(api: CobblerAPI)[source]
Bases:
ManagerModuleAbstract base class for DNS manager modules.
Defines the interface for DNS-specific service management in Cobbler.
- add_single_hosts_entry(system: System) None[source]
This method adds a single system to the host file. DNS manager modules can implement this method to improve performance. Otherwise, this method defaults to a full host regeneration.
- Parameters:
system – A system to be added.
- class cobbler.modules.managers.HttpdManagerModule(api: CobblerAPI)[source]
Bases:
ManagerModuleAbstract base class for HTTP-serving manager modules.
Deliberately minimal: unlike TFTP, there is no ongoing per-sync copy step for HTTP-serving to abstract here (the copy-skip decision for the “skip webdir copy” feature lives entirely in the importer, not in a sync-time write step). This class exists purely so that
get_module_from_file("httpd", ...)returns something with awhat()method that later tasks (the importer,cobbler check) can branch on to determine whether the admin has selected the default (copying) or dynamic (non-copying) HTTP-serving mode. It adds no abstract methods beyond whatManagerModulealready provides; the inherited no-op defaults forwrite_configs,restart_service, andsyncare correct here.
- class cobbler.modules.managers.ManagerModule(api: CobblerAPI)[source]
Bases:
objectBase class for Manager modules located in
modules/manager/*.pyThese are typically but not necessarily used to manage systemd services. Enabling can be done via settings
manage_*(e.g.manage_dhcp) andrestart_*(e.g.restart_dhcp). Different modules could manage the same functionality as dhcp can be managed via isc.py or dnsmasq.py (compare with/etc/cobbler/modules.py).- regen_ethers() None[source]
ISC/BIND doesn’t use this. It is there for compatibility reasons with other managers.
- restart_service() int[source]
Write module specific config files. E.g. dhcp manager would write
/etc/dhcpd.confhere
- sync() int[source]
This syncs the manager’s server (systemd service) with it’s new config files. Basically this restarts the service to apply the changes.
- Returns:
Integer return value of restart_service - 0 on success
- sync_single_system(system: System) int[source]
This synchronizes data for a single system. The default implementation is to trigger full synchronization. Manager modules can overwrite this method to improve performance.
- Parameters:
system – A system to be added.
- class cobbler.modules.managers.TftpManagerModule(api: CobblerAPI)[source]
Bases:
ManagerModuleAbstract base class for TFTP manager modules.
Defines the interface for TFTP-specific service management in Cobbler.
- abstractmethod add_single_distro(distro: Distro) None[source]
Add a single distribution to the TFTP configuration.
This method should be implemented by subclasses to update TFTP boot files and configuration for the specified distribution.
- Parameters:
distro – The distribution object to add.
- abstractmethod add_single_image(image: Image) None[source]
Add a single image to the TFTP configuration.
This method should be implemented by subclasses to update TFTP boot files and configuration for the specified image.
- Parameters:
image – The image object to add.
- abstractmethod sync_systems(systems: List[System], verbose: bool = True) None[source]
Synchronize TFTP configuration for the specified systems.
This method should be implemented by subclasses to update TFTP boot files and configuration for the given list of systems.
- Parameters:
systems – List of systems to synchronize.
verbose – If True, provide detailed output during synchronization.