8.1.4.1.4. cobbler.modules.managers package

8.1.4.1.4.1. Submodules

8.1.4.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: object

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.

cobbler.modules.managers.bind.register() str[source]

The mandatory Cobbler module registration hook.

8.1.4.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.

cobbler.modules.managers.dnsmasq.register() str[source]

The mandatory Cobbler modules registration hook.

Returns

Always “manage”.

8.1.4.1.4.4. 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

0 or 1, 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_genders is 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.

8.1.4.1.4.5. cobbler.modules.managers.import_signatures module

Cobbler Module that contains the code for cobbler import and provides the magic to automatically detect an ISO image OS and version.

cobbler.modules.managers.import_signatures.get_import_manager(api: CobblerAPI) _ImportSignatureManager[source]

Get an instance of the import manager which enables you to import various things.

Parameters

api – The API instance of Cobbler

Returns

The object to import data with.

cobbler.modules.managers.import_signatures.import_walker(top: str, func: Callable[[Any, str, List[str]], None], arg: Any) None[source]

Directory tree walk with callback function.

For each directory in the directory tree rooted at top (including top itself, but excluding ‘.’ and ‘..’), call func(arg, dirname, filenames). dirname is the name of the directory, and filenames a list of the names of the files and subdirectories in dirname (excluding ‘.’ and ‘..’). func may modify the filenames list in-place (e.g. via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in filenames; this can be used to implement a filter, or to impose a specific order of visiting. No semantics are defined for, or required of, arg, beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics.

Parameters
  • top – The most top directory for which func should be run.

  • func – A function which is called as described in the above description.

  • arg – Passing None for this is common.

cobbler.modules.managers.import_signatures.register() str[source]

The mandatory Cobbler module registration hook.

8.1.4.1.4.6. 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.

cobbler.modules.managers.in_tftpd.register() str[source]

The mandatory Cobbler module registration hook.

8.1.4.1.4.7. 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.

cobbler.modules.managers.isc.register() str[source]

The mandatory Cobbler module registration hook.

8.1.4.1.4.8. 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.

cobbler.modules.managers.ndjbdns.register() str[source]

The mandatory Cobbler module registration hook.

8.1.4.1.4.9. 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: ManagerModule

TODO

abstract sync_dhcp() None[source]

TODO

class cobbler.modules.managers.DnsManagerModule(api: CobblerAPI)[source]

Bases: ManagerModule

TODO

abstract regen_hosts() None[source]

TODO

class cobbler.modules.managers.ManagerModule(api: CobblerAPI)[source]

Bases: object

Base class for Manager modules located in modules/manager/*.py

These are typically but not necessarily used to manage systemd services. Enabling can be done via settings manage_* (e.g. manage_dhcp) and restart_* (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.conf here

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

static what() str[source]

Static method to identify the manager module. Must be overwritten by the inheriting class

write_configs() None[source]

Write module specific config files. E.g. dhcp manager would write /etc/dhcpd.conf here

class cobbler.modules.managers.TftpManagerModule(api: CobblerAPI)[source]

Bases: ManagerModule

TODO

abstract add_single_distro(distro: Distro) None[source]

TODO

Parameters

distro – TODO

abstract sync_single_system(system: System, menu_items: Optional[Dict[str, Union[str, Dict[str, str]]]] = None) None[source]

TODO

Parameters
  • system – TODO

  • menu_items – TODO

abstract sync_systems(systems: List[str], verbose: bool = True) None[source]

TODO

Parameters
  • systems – TODO

  • verbose – TODO

abstract write_boot_files() int[source]

TODO