cobbler.items package¶
Submodules¶
cobbler.items.distro module¶
-
class
cobbler.items.distro.
Distro
(*args, **kwargs)[source]¶ Bases:
cobbler.items.item.Item
A cobbler distribution object
-
COLLECTION_TYPE
= 'distro'¶
-
TYPE_NAME
= 'distro'¶
-
set_arch
(arch)[source]¶ The field is mainly relevant to PXE provisioning.
Using an alternative distro type allows for dhcpd.conf templating to “do the right thing” with those systems – this also relates to bootloader configuration files which have different syntax for different distro types (because of the bootloaders).
This field is named “arch” because mainly on Linux, we only care about the architecture, though if (in the future) new provisioning types are added, an arch value might be something like “bsd_x86”.
-
set_initrd
(initrd)[source]¶ Specifies an initrd image. Path search works as in set_kernel. File must be named appropriately.
-
set_kernel
(kernel)[source]¶ Specifies a kernel. The kernel parameter is a full path, a filename in the configured kernel directory (set in /etc/cobbler.conf) or a directory path that would contain a selectable kernel. Kernel naming conventions are checked, see docs in the utils module for find_kernel.
-
set_source_repos
(repos)[source]¶ A list of http:// URLs on the cobbler server that point to yum configuration files that can be used to install core packages. Use by cobbler import only.
-
cobbler.items.file module¶
-
class
cobbler.items.file.
File
(collection_mgr, is_subobject=False)[source]¶ Bases:
cobbler.resource.Resource
A Cobbler file object.
-
COLLECTION_TYPE
= 'file'¶
-
TYPE_NAME
= 'file'¶
-
cobbler.items.image module¶
-
class
cobbler.items.image.
Image
(collection_mgr, is_subobject=False)[source]¶ Bases:
cobbler.items.item.Item
A Cobbler Image. Tracks a virtual or physical image, as opposed to a answer file (autoinst) led installation.
-
COLLECTION_TYPE
= 'image'¶
-
TYPE_NAME
= 'image'¶
-
set_arch
(arch)[source]¶ The field is mainly relevant to PXE provisioning. see comments for set_arch in item_distro.py, this works the same.
-
set_autoinstall
(autoinstall)[source]¶ Set the automatic installation file path, this must be a local file.
It may not make sense for images to have automatic installation templates. It really doesn’t. However if the image type is ‘iso’ koan can create a virtual floppy and shove an answer file on it, to script an installation. This may not be a automatic installation template per se, it might be a Windows answer file (SIF) etc.
@param str local automatic installation template file path
-
set_file
(filename)[source]¶ Stores the image location. This should be accessible on all nodes that need to access it. Format: can be one of the following: * username:password@hostname:/path/to/the/filename.ext * username@hostname:/path/to/the/filename.ext * hostname:/path/to/the/filename.ext * /path/to/the/filename.ext
-
set_image_type
(image_type)[source]¶ Indicates what type of image this is. direct = something like “memdisk”, physical only iso = a bootable ISO that pxe’s or can be used for virt installs, virtual only virt-clone = a cloned virtual disk (FIXME: not yet supported), virtual only memdisk = hdd image (physical only)
-
cobbler.items.item module¶
-
class
cobbler.items.item.
Item
(collection_mgr, is_subobject=False)[source]¶ Bases:
object
An Item is a serializable thing that can appear in a Collection
-
TYPE_NAME
= 'generic'¶
-
converted_cache
= {}¶
-
get_conceptual_parent
()[source]¶ The parent may just be a superclass for something like a subprofile. Get the first parent of a different type.
-
get_descendants
(sort=False)[source]¶ Get objects that depend on this object, i.e. those that would be affected by a cascading delete, etc. With sort=True the list will be a walk of the tree, e.g., distro -> [profile, sys, sys, profile, sys, sys]
-
set_autoinstall_meta
(options)[source]¶ A comma delimited list of key value pairs, like ‘a=b,c=d,e=f’ or a dict. The meta tags are used as input to the templating system to preprocess automatic installation template files
-
set_boot_files
(boot_files)[source]¶ A comma seperated list of req_name=source_file_path that should be fetchable via tftp
-
set_fetchable_files
(fetchable_files)[source]¶ A comma seperated list of virt_name=path_to_template that should be fetchable via tftp or a webserver
-
set_kernel_options
(options)[source]¶ Kernel options are a space delimited list, like ‘a=b c=d e=f g h i=j’ or a dict.
-
set_kernel_options_post
(options)[source]¶ Post kernel options are a space delimited list, like ‘a=b c=d e=f g h i=j’ or a dict.
-
set_mgmt_classes
(mgmt_classes)[source]¶ Assigns a list of configuration management classes that can be assigned to any object, such as those used by Puppet’s external_nodes feature.
-
set_mgmt_parameters
(mgmt_parameters)[source]¶ A YAML string which can be assigned to any object, this is used by Puppet’s external_nodes feature.
-
set_name
(name)[source]¶ Set the objects name.
@param: str name (object name string) @returns: True or CX
-
set_owners
(data)[source]¶ The owners field is a comment unless using an authz module that pays attention to it, like authz_ownership, which ships with Cobbler but is off by default.
-
cobbler.items.mgmtclass module¶
-
class
cobbler.items.mgmtclass.
Mgmtclass
(*args, **kwargs)[source]¶ Bases:
cobbler.items.item.Item
-
COLLECTION_TYPE
= 'mgmtclass'¶
-
TYPE_NAME
= 'mgmtclass'¶
-
cobbler.items.package module¶
-
class
cobbler.items.package.
Package
(collection_mgr, is_subobject=False)[source]¶ Bases:
cobbler.resource.Resource
-
COLLECTION_TYPE
= 'package'¶
-
TYPE_NAME
= 'package'¶
-
cobbler.items.profile module¶
-
class
cobbler.items.profile.
Profile
(*args, **kwargs)[source]¶ Bases:
cobbler.items.item.Item
A Cobbler profile object.
-
COLLECTION_TYPE
= 'profile'¶
-
TYPE_NAME
= 'profile'¶
-
set_autoinstall
(autoinstall)[source]¶ Set the automatic OS installation template file path, this must be a local file.
@param str local automatic installation template path
-
set_distro
(distro_name)[source]¶ Sets the distro. This must be the name of an existing Distro object in the Distros collection.
Sets whether or not the profile will be listed in the default PXE boot menu. This is pretty forgiving for YAML’s sake.
-
set_name_servers
(data)[source]¶ Set the DNS servers.
@param: str/list data (string or list of nameservers) @returns: True or CX
-
set_name_servers_search
(data)[source]¶ Set the DNS search paths.
@param: str/list data (string or list of search domains) @returns: True or CX
-
set_parent
(parent_name)[source]¶ Instead of a –distro, set the parent of this object to another profile and use the values from the parent instead of this one where the values for this profile aren’t filled in, and blend them together where they are dictionaries. Basically this enables profile inheritance. To use this, the object MUST have been constructed with is_subobject=True or the default values for everything will be screwed up and this will likely NOT work. So, API users – make sure you pass is_subobject=True into the constructor when using this.
-
cobbler.items.repo module¶
-
class
cobbler.items.repo.
Repo
(*args, **kwargs)[source]¶ Bases:
cobbler.items.item.Item
A Cobbler repo object.
-
COLLECTION_TYPE
= 'repo'¶
-
TYPE_NAME
= 'repo'¶
-
get_parent
()[source]¶ currently the Cobbler object space does not support subobjects of this object as it is conceptually not useful.
-
set_createrepo_flags
(createrepo_flags)[source]¶ Flags passed to createrepo when it is called. Common flags to use would be -c cache or -g comps.xml to generate group information.
-
set_environment
(options)[source]¶ Yum can take options from the environment. This puts them there before each reposync.
-
set_keep_updated
(keep_updated)[source]¶ This allows the user to disable updates to a particular repo for whatever reason.
-
set_mirror
(mirror)[source]¶ A repo is (initially, as in right now) is something that can be rsynced. reposync/repotrack integration over HTTP might come later.
-
set_priority
(priority)[source]¶ Set the priority of the repository. 1= highest, 99=default Only works if host is using priorities plugin for yum.
-
cobbler.items.system module¶
-
class
cobbler.items.system.
System
(*args, **kwargs)[source]¶ Bases:
cobbler.items.item.Item
A Cobbler system object.
-
COLLECTION_TYPE
= 'system'¶
-
TYPE_NAME
= 'system'¶
-
get_config_filename
(interface, loader=None)[source]¶ The configuration file for each system pxe uses is either a form of the MAC address of the hex version of the IP. If none of that is available, just use the given name, though the name given will be unsuitable for PXE configuration (For this, check system.is_management_supported()). This same file is used to store system config information in the Apache tree, so it’s still relevant.
-
get_mac_address
(interface)[source]¶ Get the mac address, which may be implicit in the object name or explicit with –mac-address. Use the explicit location first.
-
is_management_supported
(cidr_ok=True)[source]¶ Can only add system PXE records if a MAC or IP address is available, else it’s a koan only record.
-
set_autoinstall
(autoinstall)[source]¶ Set the automatic installation template filepath, this must be a local file.
@param str local automatic installation template file path
-
set_dns_name
(dns_name, interface)[source]¶ Set DNS name for interface.
@param: str dns_name (dns name) @param: str interface (interface name) @returns: True or CX
-
set_gateway
(gateway)[source]¶ Set a gateway IPv4 address.
@param: str gateway (ip address) @returns: True or CX
-
set_hostname
(hostname)[source]¶ Set hostname.
@param: str hostname (hostname for system) @returns: True or CX
-
set_if_gateway
(gateway, interface)[source]¶ Set the per-interface gateway.
@param: str gateway (ipv4 address for the gateway) @param: str interface (interface name) @returns: True or CX
-
set_image
(image_name)[source]¶ Set the system to use a certain named image. Works like set_profile but cannot be used at the same time. It’s one or the other.
-
set_ip_address
(address, interface)[source]¶ Set IPv4 address on interface.
@param: str address (ip address) @param: str interface (interface name) @returns: True or CX
-
set_ipv6_address
(address, interface)[source]¶ Set IPv6 address on interface.
@param: str address (ip address) @param: str interface (interface name) @returns: True or CX
-
set_mac_address
(address, interface)[source]¶ Set mac address on interface.
@param: str address (mac address) @param: str interface (interface name) @returns: True or CX
-
set_name_servers
(data)[source]¶ Set the DNS servers.
@param: str/list data (string or list of nameservers) @returns: True or CX
-
set_name_servers_search
(data)[source]¶ Set the DNS search paths.
@param: str/list data (string or list of search domains) @returns: True or CX
-
set_netboot_enabled
(netboot_enabled)[source]¶ If true, allows per-system PXE files to be generated on sync (or add). If false, these files are not generated, thus eliminating the potential for an infinite install loop when systems are set to PXE boot first in the boot order. In general, users who are PXE booting first in the boot order won’t create system definitions, so this feature primarily comes into play for programmatic users of the API, who want to initially create a system with netboot enabled and then disable it after the system installs, as triggered by some action in automatic installation file’s %post section. For this reason, this option is not urfaced in the CLI, output, or documentation (yet).
Use of this option does not affect the ability to use PXE menus. If an admin has machines set up to PXE only after local boot fails, this option isn’t even relevant.
-
set_netmask
(netmask, interface)[source]¶ Set the netmask for given interface.
@param: str netmask (netmask) @param: str interface (interface name) @returns: True or CX
-
set_profile
(profile_name)[source]¶ Set the system to use a certain named profile. The profile must have already been loaded into the Profiles collection.
-