cobbler.actions package¶
Submodules¶
cobbler.actions.acl module¶
Configures acls for various users/groups so they can access the cobbler command line as non-root. Now that CLI is largely remoted (XMLRPC) this is largely just useful for not having to log in (access to shared-secret) file but also grants access to hand-edit various cobbler_collections files and other useful things.
cobbler.actions.buildiso module¶
Builds bootable CD images that have PXE-equivalent behavior for all Cobbler distros/profiles/systems currently in memory.
-
class
cobbler.actions.buildiso.
BuildIso
(collection_mgr, verbose=False, logger=None)[source]¶ Bases:
object
Handles conversion of internal state to the isolinux tree layout
-
copy_boot_files
(distro, destdir, prefix=None)[source]¶ Copy kernel/initrd to destdir with (optional) newfile prefix
-
filter_systems_or_profiles
(selected_items, list_type)[source]¶ Return a list of valid profile or system objects selected from all profiles or systems by name, or everything if selected_items is empty
-
generate_netboot_iso
(imagesdir, isolinuxdir, profiles=None, systems=None, exclude_dns=None)[source]¶ Create bootable CD image to be used for network installations
-
cobbler.actions.check module¶
-
class
cobbler.actions.check.
CobblerCheck
(collection_mgr, logger=None)[source]¶ Bases:
object
Validates whether the system is reasonably well configured for serving up content. This is the code behind ‘cobbler check’.
-
check_dhcpd_conf
(status)[source]¶ NOTE: this code only applies if cobbler is NOT set to generate a dhcp.conf file
Check that dhcpd appears to be configured for pxe booting. We can’t assure file correctness. Since a cobbler user might have dhcp on another server, it’s okay if it’s not there and/or not configured correctly according to automated scans.
-
check_name
(status)[source]¶ If the server name in the config file is still set to localhost automatic installations run from koan will not have proper kernel line parameters.
-
cobbler.actions.dlcontent module¶
Downloads bootloader content for all arches for when the user doesn’t want to supply their own.
-
class
cobbler.actions.dlcontent.
ContentDownloader
(collection_mgr, logger=None)[source]¶ Bases:
object
-
run
(force=False)[source]¶ Download bootloader content for all of the latest bootloaders, since the user has chosen to not supply their own. You may ask “why not get this from yum”, we also want this to be able to work on Debian and further do not want folks to have to install a cross compiler. For those that don’t like this approach they can still source their cross-arch bootloader content manually.
-
cobbler.actions.hardlink module¶
Hard links cobbler content together to save space.
cobbler.actions.litesync module¶
Running small pieces of cobbler sync when certain actions are taken, such that we don’t need a time consuming sync when adding new systems if nothing has changed for systems that have already been created.
cobbler.actions.log module¶
cobbler.actions.replicate module¶
Replicate from a cobbler master.
-
class
cobbler.actions.replicate.
Replicate
(collection_mgr, logger=None)[source]¶ Bases:
object
-
run
(cobbler_master=None, port='80', distro_patterns=None, profile_patterns=None, system_patterns=None, repo_patterns=None, image_patterns=None, mgmtclass_patterns=None, package_patterns=None, file_patterns=None, prune=False, omit_data=False, sync_all=False, use_ssl=False)[source]¶ Get remote profiles and distros and sync them locally
-
cobbler.actions.report module¶
Report from a cobbler master. FIXME: reinstante functionality for 2.0
-
class
cobbler.actions.report.
Report
(collection_mgr, logger=None)[source]¶ Bases:
object
-
print_formatted_data
(data, order, report_type, noheaders)[source]¶ Used for picking the correct format to output data as
-
reporting_mediawiki
(info, order, noheaders)[source]¶ Formats data on ‘info’ for mediawiki table output
-
reporting_print_all_fields
(collection, report_name, report_type, report_noheaders)[source]¶ Prints all fields in a collection as a table given the report type
-
reporting_print_x_fields
(collection, report_name, report_type, report_fields, report_noheaders)[source]¶ Prints specific fields in a collection as a table given the report type
-
run
(report_what=None, report_name=None, report_type=None, report_fields=None, report_noheaders=None)[source]¶ Get remote profiles and distros and sync them locally
Handles original report output
Handles all fields of report outputs as table given a format
Handles specific fields of report outputs as table given a format
-
cobbler.actions.reposync module¶
Builds out and synchronizes yum repo mirrors. Initial support for rsync, perhaps reposync coming later.
-
class
cobbler.actions.reposync.
RepoSync
(collection_mgr, tries=1, nofail=False, logger=None)[source]¶ Bases:
object
Handles conversion of internal state to the tftpboot tree layout
-
create_local_file
(dest_path, repo, output=True)[source]¶ Creates Yum config files for use by reposync
Two uses: (A) output=True, Create local files that can be used with yum on provisioned clients to make use of this mirror. (B) output=False, Create a temporary file for yum to feed into yum for mirroring
-
run
(name=None, verbose=True)[source]¶ Syncs the current repo configuration file with the filesystem.
-
-
cobbler.actions.reposync.
repo_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.actions.status module¶
Reports on automatic installation activity by examining the logs in /var/log/cobbler.
cobbler.actions.sync module¶
Builds out filesystem trees/data based on the object tree. This is the code behind ‘cobbler sync’.
-
class
cobbler.actions.sync.
CobblerSync
(collection_mgr, verbose=True, dhcp=None, dns=None, logger=None, tftpd=None)[source]¶ Bases:
object
Handles conversion of internal state to the tftpboot tree layout
-
clean_trees
()[source]¶ Delete any previously built pxelinux.cfg tree and virt tree info and then create directories.
Note: for SELinux reasons, some information goes in /tftpboot, some in /var/www/cobbler and some must be duplicated in both. This is because PXE needs tftp, and automatic installation and Virt operations need http. Only the kernel and initrd images are duplicated, which is unfortunate, though SELinux won’t let me give them two contexts, so symlinks are not a solution. Otherwise duplication is minimal.
-