cobbler.modules.managers package

Submodules

cobbler.modules.managers.bind module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.bind.BindManager(collection_mgr, logger)[source]

Bases: object

regen_hosts()[source]
what()[source]
write_dns_files()[source]

BIND files are written when manage_dns is set in /var/lib/cobbler/settings.

cobbler.modules.managers.bind.get_manager(collection_mgr, logger)[source]
cobbler.modules.managers.bind.register()[source]

The mandatory cobbler module registration hook.

cobbler.modules.managers.dnsmasq module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.dnsmasq.DnsmasqManager(collection_mgr, logger, dhcp=None)[source]

Bases: object

Handles conversion of internal state to the tftpboot tree layout

regen_ethers()[source]
regen_hosts()[source]
remove_dhcp_lease(port, host)[source]
sync_dhcp()[source]
what()[source]
write_dhcp_file()[source]

DHCP files are written when manage_dhcp is set in /etc/cobbler/settings.

write_dhcp_lease(port, host, ip, mac)[source]
write_dns_files()[source]
cobbler.modules.managers.dnsmasq.get_manager(collection_mgr, logger)[source]
cobbler.modules.managers.dnsmasq.register()[source]

cobbler.modules.managers.genders module

cobbler.modules.managers.genders.register()[source]
cobbler.modules.managers.genders.run(api, args, logger)[source]
cobbler.modules.managers.genders.write_genders_file(config, profiles_genders, distros_genders, mgmtcls_genders)[source]

genders file is over-written when manage_genders is set in /var/lib/cobbler/settings.

cobbler.modules.managers.import_signatures module

class cobbler.modules.managers.import_signatures.ImportSignatureManager(collection_mgr, logger)[source]

Bases: object

add_entry(dirname, kernel, initrd)[source]

When we find a directory with a valid kernel/initrd in it, create the distribution objects as appropriate and save them. This includes creating xen and rescue distros/profiles if possible.

apt_repo_adder(distro)[source]
arch_walker(foo, dirname, fnames)[source]

Function for recursively searching through a directory for a kernel file matching a given architecture, called by learn_arch_from_tree()

configure_tree_location(distro)[source]

Once a distribution is identified, find the part of the distribution that has the URL in it that we want to use for automating the Linux distribution installation, and create a autoinstall_meta variable $tree that contains this.

distro_adder(distros_added, dirname, fnames)[source]

This is an import_walker routine that finds distributions in the directory to be scanned and then creates them.

get_file_lines(filename)[source]

Get lines from a file, which may or may not be compressed

get_proposed_name(dirname, kernel=None)[source]

Given a directory name where we have a kernel/initrd pair, try to autoname the distribution (and profile) object based on the contents of that path

get_repo_mirror_from_apt()[source]

This tries to determine the apt mirror/archive to use (when processing repos) if the host machine is Debian or Ubuntu.

get_valid_arches()[source]
get_valid_repo_breeds()[source]
learn_arch_from_tree()[source]

If a distribution is imported from DVD, there is a good chance the path doesn’t contain the arch and we should add it back in so that it’s part of the meaningful name … so this code helps figure out the arch name. This is important for producing predictable distro names (and profile names) from differing import sources

repo_finder(distros_added)[source]

This routine looks through all distributions and tries to find any applicable repositories in those distributions for post-install usage.

rhn_repo_adder(distro)[source]

not currently used

rsync_repo_adder(distro)[source]

not currently used

run(path, name, network_root=None, autoinstall_file=None, arch=None, breed=None, os_version=None)[source]

path: the directory we are scanning for files name: the base name of the distro network_root: the remote path (nfs/http/ftp) for the distro files autoinstall_file: user-specified response file, which will override the default arch: user-specified architecture breed: user-specified breed os_version: user-specified OS version

scan_signatures()[source]

loop through the signatures, looking for a match for both the signature directory and the version file

set_install_tree(distro, url)[source]

Simple helper function to set the tree automated installation metavariable

what()[source]
yum_process_comps_file(comps_path, distro)[source]

When importing Fedora/EL certain parts of the install tree can also be used as yum repos containing packages that might not yet be available via updates in yum. This code identifies those areas. Existing repodata will be used as-is, but repodate is created for earlier, non-yum based, installers.

yum_repo_adder(distro)[source]

For yum, we recursively scan the rootdir for repos to add

yum_repo_scanner(distro, dirname, fnames)[source]

This is an import_walker routine that looks for potential yum repositories to be added to the configuration for post-install usage.

cobbler.modules.managers.import_signatures.get_import_manager(config, logger)[source]
cobbler.modules.managers.import_signatures.import_walker(top, func, arg)[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, fnames). dirname is the name of the directory, and fnames a list of the names of the files and subdirectories in dirname (excluding ‘.’ and ‘..’). func may modify the fnames list in-place (e.g. via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in fnames; 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. Passing None for arg is common.

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

The mandatory cobbler module registration hook.

cobbler.modules.managers.in_tftpd module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.in_tftpd.InTftpdManager(collection_mgr, logger)[source]

Bases: object

add_single_distro(distro)[source]
add_single_system(system)[source]

Write out new pxelinux.cfg files to /tftpboot

regen_hosts()[source]
sync(verbose=True)[source]

Write out all files to /tftpdboot

update_netboot(name)[source]

Write out new pxelinux.cfg files to /tftpboot

what()[source]
write_boot_files()[source]

Copy files in profile[“boot_files”] into /tftpboot. Used for vmware currently.

write_boot_files_distro(distro)[source]
write_dns_files()[source]
cobbler.modules.managers.in_tftpd.get_manager(collection_mgr, logger)[source]
cobbler.modules.managers.in_tftpd.register()[source]

The mandatory cobbler module registration hook.

cobbler.modules.managers.isc module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.isc.IscManager(collection_mgr, logger)[source]

Bases: object

regen_ethers()[source]
sync_dhcp()[source]
what()[source]
write_dhcp_file()[source]

DHCP files are written when manage_dhcp is set in /etc/cobbler/settings.

cobbler.modules.managers.isc.get_manager(collection_mgr, logger)[source]
cobbler.modules.managers.isc.register()[source]

The mandatory cobbler module registration hook.

cobbler.modules.managers.ndjbdns module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.ndjbdns.NDjbDnsManager(config, logger)[source]

Bases: object

regen_hosts()[source]
what()[source]
write_dns_files()[source]
cobbler.modules.managers.ndjbdns.get_manager(config, logger)[source]
cobbler.modules.managers.ndjbdns.register()[source]

cobbler.modules.managers.tftpd_py module

This is some of the code behind ‘cobbler sync’.

class cobbler.modules.managers.tftpd_py.TftpdPyManager(collection_mgr, logger)[source]

Bases: object

add_single_distro(distro)[source]
add_single_system(name)[source]

Write out files to /tftpdboot. Unused for the python server

regen_hosts()[source]
sync(verbose=True)[source]

Write out files to /tftpdboot. Mostly unused for the python server

update_netboot(name)[source]

Write out files to /tftpdboot. Unused for the python server

what()[source]
write_boot_files()[source]

Copy files in profile[“boot_files”] into /tftpboot. Used for vmware currently.

write_boot_files_distro(distro)[source]

Copy files in profile[“boot_files”] into /tftpboot. Used for vmware currently.

write_dns_files()[source]
cobbler.modules.managers.tftpd_py.get_manager(collection_mgr, logger)[source]
cobbler.modules.managers.tftpd_py.register()[source]

The mandatory cobbler module registration hook.

Module contents