7.1.6. cobbler.items package
7.1.6.1. Subpackages
- 7.1.6.1.1. cobbler.items.abstract package
- 7.1.6.1.1.1. Submodules
- 7.1.6.1.1.2. cobbler.items.abstract.base_item module
BaseItemBaseItem.COLLECTION_TYPEBaseItem.TYPE_NAMEBaseItem.cacheBaseItem.check_if_valid()BaseItem.clean_cache()BaseItem.commentBaseItem.ctimeBaseItem.deserialize()BaseItem.find_match()BaseItem.find_match_single_key()BaseItem.from_dict()BaseItem.in_transactionBaseItem.inmemoryBaseItem.make_clone()BaseItem.mtimeBaseItem.nameBaseItem.ownersBaseItem.serialize()BaseItem.sort_key()BaseItem.to_dict()BaseItem.uid
- 7.1.6.1.1.3. cobbler.items.abstract.bootable_item module
- 7.1.6.1.1.4. cobbler.items.abstract.inheritable_item module
HierarchyItemInheritableItemInheritableItem.COLLECTION_TYPEInheritableItem.LOGICAL_INHERITANCEInheritableItem.TYPE_DEPENDENCIESInheritableItem.TYPE_NAMEInheritableItem.childrenInheritableItem.depthInheritableItem.descendantsInheritableItem.get_conceptual_parent()InheritableItem.get_parentInheritableItem.grab_tree()InheritableItem.is_subobjectInheritableItem.logical_parentInheritableItem.parentInheritableItem.tree_walk()
LogicalHierarchy
- 7.1.6.1.1.5. cobbler.items.abstract.item_cache module
- 7.1.6.1.1.6. cobbler.items.abstract.item_group module
- 7.1.6.1.1.7. Module contents
- 7.1.6.1.2. cobbler.items.options package
- 7.1.6.1.2.1. Submodules
- 7.1.6.1.2.2. cobbler.items.options.base module
- 7.1.6.1.2.3. cobbler.items.options.dns module
- 7.1.6.1.2.4. cobbler.items.options.ip module
- 7.1.6.1.2.5. cobbler.items.options.package module
- 7.1.6.1.2.6. cobbler.items.options.power module
- 7.1.6.1.2.7. cobbler.items.options.tftp module
- 7.1.6.1.2.8. cobbler.items.options.uri module
- 7.1.6.1.2.9. cobbler.items.options.virt module
- 7.1.6.1.2.10. Module contents
7.1.6.2. Submodules
7.1.6.3. cobbler.items.distro module
Cobbler module that contains the code for a Cobbler distro object.
Changelog:
Schema: From -> To
- V3.4.0 (unreleased):
- Added:
find_distro_path()link_distro()redhat_management_org: enums.VALUE_INHERITEDredhat_management_user: enums.VALUE_INHERITEDredhat_management_password: enums.VALUE_INHERITED
- Changed:
Constructor:
kwargscan now be used to seed the item during creation.children: The property was moved to the base class.from_dict(): The method was moved to the base class.
- V3.3.4 (unreleased):
No changes
- V3.3.3:
- Changed:
redhat_management_key: Inherits from the settings again
- V3.3.2:
No changes
- V3.3.1:
No changes
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
from_dict()
- Moved to base class (Item):
ctime: floatdepth: intmtime: floatuid: strkernel_options: dictkernel_options_post: dictautoinstall_meta: dictboot_files: list/dicttemplate_files: list/dictcomment: strname: strowners: list[str]
- Changed:
tree_build_time: str -> floatarch: str -> Union[list, str]fetchable_files: list/dict? -> dictboot_loader-> boot_loaders (rename)
- Removed:
get_fields()get_parentset_kernel()- Please use the propertykernelset_remote_boot_kernel()- Please use the propertyremote_boot_kernelset_tree_build_time()- Please use the propertytree_build_timeset_breed()- Please use the propertybreedset_os_version()- Please use the propertyos_versionset_initrd()- Please use the propertyinitrdset_remote_boot_initrd()- Please use the propertyremote_boot_initrdset_source_repos()- Please use the propertysource_reposset_arch()- Please use the propertyarchget_arch()- Please use the propertyarchset_supported_boot_loaders()- Please use the propertysupported_boot_loaders. It is readonly.set_boot_loader()- Please use the propertyboot_loaderset_redhat_management_key()- Please use the propertyredhat_management_keyget_redhat_management_key()- Please use the propertyredhat_management_key
- V3.2.2:
No changes
- V3.2.1:
- Added:
kickstart: Resolves as a proxy toautoinstall
- V3.2.0:
No changes
- V3.1.2:
- Added:
remote_boot_kernel: strremote_grub_kernel: strremote_boot_initrd: strremote_grub_initrd: str
- V3.1.1:
No changes
- V3.1.0:
- Added:
get_arch()
- V3.0.1:
File was moved from
cobbler/item_distro.pytocobbler/items/distro.py.
- V3.0.0:
- Added:
boot_loader: Union[str, inherit]
- Changed:
rename:
ks_meta->autoinstall_metaredhat_management_key: Union[str, inherit] -> str
- Removed:
redhat_management_server: Union[str, inherit]
- V2.8.5:
Inital tracking of changes for the changelog.
- Added:
name: strctime: floatmtime: floatuid: strowners: Union[list, SETTINGS:default_ownership]kernel: strinitrd: strkernel_options: dictkernel_options_post: dictks_meta: dictarch: strbreed: stros_version: strsource_repos: listdepth: intcomment: strtree_build_time: strmgmt_classes: listboot_files: list/dict?fetchable_files: list/dict?template_files: list/dict?redhat_management_key: Union[str, inherit]redhat_management_server: Union[str, inherit]
- class cobbler.items.distro.Distro(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BootableItemA Cobbler distribution object
- COLLECTION_TYPE = 'distro'
- TYPE_NAME = 'distro'
- property arch
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”.
- Returns:
Return the current architecture.
- property boot_loaders: List[BootLoader]
All boot loaders for which Cobbler generates entries for.
Note
This property can be set to
<<inherit>>.- Getter:
The bootloaders.
- Setter:
Validates this against the list of well-known bootloaders and raises a
TypeErrororValueErrorin case the validation goes south.
- property breed: str
The repository system breed. This decides some defaults for most actions with a repo in Cobbler.
- Getter:
The breed detected.
- Setter:
May raise a
ValueErrororTypeErrorin case the given value is wrong.
- property distro_groups: List[DistroGroup]
Finds all DistroGroups that this distro is a member of.
- find_distro_path()[source]
This returns the absolute path to the distro under the
distro_mirrordirectory. If that directory doesn’t contain the kernel, the directory of the kernel in the distro is returned.- Returns:
The path to the distribution files.
- property initrd: str
Specifies an initrd image. Path search works as in set_kernel. File must be named appropriately.
- Getter:
The current path to the initrd.
- Setter:
May raise a
TypeErrororValueErrorin case the validation is not successful.
- property kernel: str
Specifies a kernel. The kernel parameter is a full path, a filename in the configured kernel directory or a directory path that would contain a selectable kernel. Kernel naming conventions are checked, see docs in the utils module for
find_kernel.- Getter:
The last successfully validated kernel path.
- Setter:
May raise a
ValueErrororTypeErrorin case of validation errors.
- link_distro()[source]
Link a Cobbler distro from its source into the web directory to make it reachable from the outside.
- make_clone()[source]
Clone a distro object.
- Returns:
The cloned object. Not persisted on the disk or in a database.
- property os_version: str
The operating system version which the image contains.
- Getter:
The sanitized operating system version.
- Setter:
Accepts a str which will be validated against the
distro_signatures.json.
- property parent
Distros don’t have parent objects.
- property redhat_management_key: str
Get the redhat management key. This is probably only needed if you have spacewalk, uyuni, or SUSE Manager running. Or if you are registering via Red Hat subscription-manager.
Note
This property can be set to
<<inherit>>.- Returns:
The key as a string.
- property redhat_management_org: str
Get the redhat management organization. This is only needed if you are registering via Red Hat subscription-manager.
Note
This property can be set to
<<inherit>>.- Returns:
The organization as a string.
- property redhat_management_password: str
Get the redhat management password. This is only needed if you are registering via Red Hat subscription-manager.
Note
This property can be set to
<<inherit>>.- Returns:
The password as a string.
- property redhat_management_user: str
Get the redhat management user. This is only needed if you are registering via Red Hat subscription-manager.
Note
This property can be set to
<<inherit>>.- Returns:
The user as a string.
- property remote_boot_initrd: str
URL to a remote initrd. If the bootloader supports this feature, it directly tries to retrieve the initrd and boot it. (grub supports tftp and http protocol and server must be an IP).
- Getter:
Returns the current remote URL to boot from.
- Setter:
Raises a
TypeErrororValueErrorin case the provided value was not correct.
- property remote_boot_kernel: str
URL to a remote kernel. If the bootloader supports this feature, it directly tries to retrieve the kernel and boot it. (grub supports tftp and http protocol and server must be an IP).
- Getter:
Returns the current remote URL to boot from.
- Setter:
Raises a
TypeErrororValueErrorin case the provided value was not correct.
- property remote_grub_initrd: str
This is tied to the
remote_boot_initrdproperty. It contains the URL of that field in a format which grub can use directly.- Getter:
The computed URL from
remote_boot_initrd.
- property remote_grub_kernel: str
This is tied to the
remote_boot_kernelproperty. It contains the URL of that field in a format which grub can use directly.- Getter:
The computed URL from
remote_boot_kernel.
- property source_repos: List[str]
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 importonly.- Getter:
The source repos used.
- Setter:
The new list of source repos to use.
- property supported_boot_loaders: List[BootLoader]
Some distributions, particularly on powerpc, can only be netbooted using specific bootloaders.
- Returns:
The bootloaders which are available for being set.
7.1.6.4. cobbler.items.distro_group module
DistroGroup class for grouping distros.
7.1.6.5. cobbler.items.image module
Cobbler module that contains the code for a Cobbler image object.
Changelog:
- V3.4.0 (unreleased):
- Added:
display_name
- Changed:
Constructor:
kwargscan now be used to seed the item during creation.autoinstall: Restored inheritance of the property.children: The proqperty was moved to the base class.from_dict(): The method was moved to the base class.virt_disk_driver: Restored inheritance of the property.virt_ram: Restored inheritance of the property.virt_type: Restored inheritance of the property.virt_bridge: Restored inheritance of the property.
- V3.3.4 (unreleased):
No changes
- V3.3.3:
- Added:
children
- Changes:
virt_file_size: Inherits from the settings againboot_loaders: Inherits from the settings again
- V3.3.2:
No changes
- V3.3.1:
No changes
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
boot_loaders: listmenu: strsupported_boot_loaders: listfrom_dict()
- Moved to parent class (Item):
ctime: floatmtime: floatdepth: intparent: struid: strcomment: strname: str
- Removed:
get_fields()get_parent()set_arch()- Please use thearchproperty.set_autoinstall()- Please use theautoinstallproperty.set_file()- Please use thefileproperty.set_os_version()- Please use theos_versionproperty.set_breed()- Please use thebreedproperty.set_image_type()- Please use theimage_typeproperty.set_virt_cpus()- Please use thevirt_cpusproperty.set_network_count()- Please use thenetwork_countproperty.set_virt_auto_boot()- Please use thevirt_auto_bootproperty.set_virt_file_size()- Please use thevirt_file_sizeproperty.set_virt_disk_driver()- Please use thevirt_disk_driverproperty.set_virt_ram()- Please use thevirt_ramproperty.set_virt_type()- Please use thevirt_typeproperty.set_virt_bridge()- Please use thevirt_bridgeproperty.set_virt_path()- Please use thevirt_pathproperty.get_valid_image_types()
- Changes:
arch: str -> enums.Archsautoinstall: str -> enums.VALUE_INHERITEDimage_type: str -> enums.ImageTypesvirt_auto_boot: Union[bool, SETTINGS:virt_auto_boot] -> boolvirt_bridge: Union[str, SETTINGS:default_virt_bridge] -> strvirt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver] -> enums.VirtDiskDriversvirt_file_size: Union[float, SETTINGS:default_virt_file_size] -> floatvirt_ram: Union[int, SETTINGS:default_virt_ram] -> intvirt_type: Union[str, SETTINGS:default_virt_type] -> enums.VirtType
- V3.2.2:
No changes
- V3.2.1:
- Added:
kickstart: Resolves as a proxy toautoinstall
- V3.2.0:
No changes
- V3.1.2:
No changes
- V3.1.1:
No changes
- V3.1.0:
No changes
- V3.0.1:
No changes
- V3.0.0:
- Added:
set_autoinstall()
- Changes:
Rename:
kickstart->autoinstall
- Removed:
set_kickstart()- Please useset_autoinstall()
- V2.8.5:
Inital tracking of changes for the changelog.
- Added:
ctime: floatdepth: intmtime: floatparent: struid: strarch: strkickstart: strbreed: strcomment: strfile: strimage_type: strname: strnetwork_count: intos_version: strowners: Union[list, SETTINGS:default_ownership]virt_auto_boot: Union[bool, SETTINGS:virt_auto_boot]virt_bridge: Union[str, SETTINGS:default_virt_bridge]virt_cpus: intvirt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver]virt_file_size: Union[float, SETTINGS:default_virt_file_size]virt_path: strvirt_ram: Union[int, SETTINGS:default_virt_ram]virt_type: Union[str, SETTINGS:default_virt_type]
- class cobbler.items.image.Image(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BootableItemA Cobbler Image. Tracks a virtual or physical image, as opposed to a answer file (autoinst) led installation.
- COLLECTION_TYPE = 'image'
- TYPE_NAME = 'image'
- property arch: Archs
Represents the architecture the image has. If deployed to a physical host this should be enforced, a virtual image may be deployed on a host with any architecture.
- Getter:
The current architecture. Default is
X86_64.- Setter:
Should be of the enum type or str. May raise an exception in case the architecture is not known to Cobbler.
- property autoinstall: Template | None
Represents the automatic OS installation template object.
- Getter:
The template object that is configured.
- Setter:
The name, UID or Template object. This property may be set to
<<inherit>>.
- property boot_loaders: List[BootLoader]
Represents the boot loaders which are able to boot this image.
- Getter:
The bootloaders. May be an emtpy list.
- Setter:
A list with the supported boot loaders for this image.
- property breed: str
The operating system breed.
- Getter:
Returns the current breed.
- Setter:
When setting this it is validated against the
distro_signatures.jsonfile.
- property display_name: str
Returns the display name.
- Getter:
Returns the display name for the boot menu.
- Setter:
Sets the display name for the boot menu.
- property file: str
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
- Getter:
The path to the image location or an emtpy string.
- Setter:
May raise a TypeError or SyntaxError in case the validation of the location fails.
- property image_type: ImageTypes
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)
- Getter:
The enum type value of the image type.
- Setter:
Accepts str like and enum type values and raises a TypeError or ValueError in the case of a problem.
- make_clone()[source]
Clone this image object. Please manually adjust all value yourself to make the cloned object unique.
- Returns:
The cloned instance of this object.
Property to represent the menu which this image should be put into.
- Getter:
The name of the menu or an emtpy str.
- Setter:
Should only be the name of the menu not the object. May raise
CXin case the menu does not exist.
- property network_count: int
Represents the number of virtual NICs this image has.
Deprecated since version 3.3.0: This is nowhere used in the project and will be removed in a future release.
- Getter:
The number of networks.
- Setter:
Raises a
TypeErrorin case the value is not an int.
- property os_version: str
The operating system version which the image contains.
- Getter:
The sanitized operating system version.
- Setter:
Accepts a str which will be validated against the
distro_signatures.json.
- property supported_boot_loaders: List[BootLoader]
Read only property which represents the subset of settable bootloaders.
- Getter:
The bootloaders which are available for being set.
- property virt: VirtOption
Property for the VirtOptions.
- Getter:
The VirtOptions of the Image.
- property virt_bridge: str
The name of the virtual bridge used for networking.
Warning
The new validation for the setter is not working. Thus the inheritance from the settings is broken.
- Getter:
The name of the bridge.
- Setter:
The new name of the bridge. If set to an empty
str, it will be taken from the settings.
7.1.6.7. cobbler.items.network_interface module
All code belonging to network interfaces
Changelog (NetworkInterface):
- V3.4.0 (unreleased):
- Changes:
The NetworkInterface class is now a dedicated item type.
Constructor:
kwargscan now be used to seed the item during creation.virt_type: str - Inheritable; One of “qemu”, “kvm”, “xenpv”, “xenfv”, “vmware”, “vmwarew”, “openvz” or “auto”.
- V3.3.4 (unreleased):
No changes
- V3.3.3:
- Changed:
to_dict(): Accepts new parameterresolvedvirt_bridge: Can now be set to<<inherit>>to get its value from the settings keydefault_virt_bridge
- V3.3.2:
No changes
- V3.3.1:
No changes
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
NetworkInterfaceis now a class.Serialization still happens inside the system collection.
Properties have been used.
- V3.2.2:
No changes
- V3.2.1:
No changes
- V3.2.0:
No changes
- V3.1.2:
No changes
- V3.1.1:
No changes
- V3.1.0:
No changes
- V3.0.1:
No changes
- V3.0.0:
Field definitions now split of
Systemclass
- V2.8.5:
Initial tracking of changes for the changelog.
Field definitions part of
Systemclass- Added:
mac_address: strconnected_mode: boolmtu: strip_address: strinterface_type: str - One of “na”, “bond”, “bond_slave”, “bridge”, bridge_slave”, “bonded_bridge_slave”, “infiniband”interface_master: strbonding_opts: strbridge_opts: strmanagement: boolstatic: boolnetmask: strif_gateway: strdhcp_tag: strdns_name: strstatic_routes: List[str]virt_bridge: stripv6_address: stripv6_prefix: stripv6_secondaries: List[str]ipv6_mtu: stripv6_static_routes: List[str]ipv6_default_gateway: strcnames: List[str]
- class cobbler.items.network_interface.NetworkInterface(api: CobblerAPI, system_uid: str, *args: Any, **kwargs: Any)[source]
Bases:
BaseItemA subobject of a Cobbler System which represents the network interfaces
- COLLECTION_TYPE = 'network_interface'
- TYPE_NAME = 'network_interface'
- property bonding_opts: str
bonding_opts property.
- Getter:
Returns the value for
bonding_opts.- Setter:
Sets the value for the property
bonding_opts.
- property bridge_opts: str
bridge_opts property.
- Getter:
Returns the value for
bridge_opts.- Setter:
Sets the value for the property
bridge_opts.
- check_if_valid()[source]
Checks if the current item passes logical validation.
- Raises:
CX – In case name is missing. Additionally either image or profile is required.
- property connected_mode: bool
connected_mode property.
- Getter:
Returns the value for
connected_mode.- Setter:
Sets the value for the property
connected_mode.
- property dhcp_tag: str
dhcp_tag property.
- Getter:
Returns the value for
dhcp_tag.- Setter:
Sets the value for the property
dhcp_tag.
- property dns: DNSInterfaceOption
Returns the DNS configuration option for this network interface.
- property if_gateway: str
if_gateway property.
- Getter:
Returns the value for
if_gateway.- Setter:
Sets the value for the property
if_gateway.
- property interface_master: str
interface_master property.
- Getter:
Returns the value for
interface_master.- Setter:
Sets the value for the property
interface_master.
- property interface_type: NetworkInterfaceType
interface_type property.
- Getter:
Returns the value for
interface_type.- Setter:
Sets the value for the property
interface_type.
- property ipv4: IPv4Option
Returns the IPv4 configuration option for this network interface.
- property ipv6: IPv6Option
Returns the IPv6 configuration option for this network interface.
- property ipv6_default_gateway: str
ipv6_default_gateway property.
- Getter:
Returns the value for
ipv6_default_gateway.- Setter:
Sets the value for the property
ipv6_default_gateway.
- property ipv6_static_routes: List[str]
ipv6_static_routes property.
- Getter:
Returns the value for
ipv6_static_routes.- Setter:
Sets the value for the property ipv6_static_routes`.
- property mac_address: str
mac_address property.
- Getter:
Returns the value for
mac_address.- Setter:
Sets the value for the property
mac_address.
- make_clone() NetworkInterface[source]
Clone this file object. Please manually adjust all value yourself to make the cloned object unique.
- Returns:
The cloned instance of this object.
- property management: bool
management property.
- Getter:
Returns the value for
management.- Setter:
Sets the value for the property
management.
- property static: bool
static property.
- Getter:
Returns the value for
static.- Setter:
Sets the value for the property
static.
- property system_name: str
system_name property.
- Getter:
Returns the value for
system_name.- Setter:
Sets the value for the property
system_name.
7.1.6.8. cobbler.items.profile module
Cobbler module that contains the code for a Cobbler profile object.
Changelog:
- V3.4.0 (unreleased):
- Changes:
Constructor:
kwargscan now be used to seed the item during creation.children: The property was moved to the base class.parent: The property was moved to the base class.from_dict(): The method was moved to the base class.
- Added:
redhat_management_org: enums.VALUE_INHERITEDredhat_management_user: enums.VALUE_INHERITEDredhat_management_password: enums.VALUE_INHERITED
- V3.3.4 (unreleased):
No changes
- V3.3.3:
- Changed:
next_server_v4: str -> enums.VALUE_INHERITEDnext_server_v6: str -> enums.VALUE_INHERITEDvirt_bridge: str -> enums.VALUE_INHERITEDvirt_file_size: int -> enums.VALUE_INHERITEDvirt_ram: int -> enums.VALUE_INHERITED
- V3.3.2:
No changes
- V3.3.1:
No changes
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
boot_loaders: Union[list, str]enable_ipxe: boolnext_server_v4: strnext_server_v6: strmenu: strfrom_dict()
- Removed:
enable_gpxe: Union[bool, SETTINGS:enable_gpxe]next_server: Union[str, inherit]get_fields()get_parent(): Please use the propertyparentinsteadset_parent(): Please use the propertyparentinsteadset_distro(): Please use the propertydistroinsteadset_name_servers(): Please use the propertyname_serversinsteadset_name_servers_search(): Please use the propertyname_servers_searchinsteadset_proxy(): Please use the propertyproxyinsteadset_enable_gpxe(): Please use the propertyenable_gpxeinsteadset_enable_menu(): Please use the propertyenable_menuinsteadset_dhcp_tag(): Please use the propertydhcp_taginsteadset_server(): Please use the propertyserverinsteadset_next_server(): Please use the propertynext_serverinsteadset_filename(): Please use the propertyfilenameinsteadset_autoinstall(): Please use the propertyautoinstallinsteadset_virt_auto_boot(): Please use the propertyvirt_auto_bootinsteadset_virt_cpus(): Please use the propertyvirt_cpusinsteadset_virt_file_size(): Please use the propertyvirt_file_sizeinsteadset_virt_disk_driver(): Please use the propertyvirt_disk_driverinsteadset_virt_ram(): Please use the propertyvirt_raminsteadset_virt_type(): Please use the propertyvirt_typeinsteadset_virt_bridge(): Please use the propertyvirt_bridgeinsteadset_virt_path(): Please use the propertyvirt_pathinsteadset_repos(): Please use the propertyreposinsteadset_redhat_management_key(): Please use the propertyredhat_management_keyinsteadget_redhat_management_key(): Please use the propertyredhat_management_keyinsteadget_arch(): Please use the propertyarchinstead
- Changed:
autoinstall: Union[str, SETTINGS:default_kickstart] -> enums.VALUE_INHERITEDenable_menu: Union[bool, SETTINGS:enable_menu] -> boolname_servers: Union[list, SETTINGS:default_name_servers] -> listname_servers_search: Union[list, SETTINGS:default_name_servers_search] -> listfilename: Union[str, inherit] -> strproxy: Union[str, SETTINGS:proxy_url_int] -> enums.VALUE_INHERITEDredhat_management_key: Union[str, inherit] -> enums.VALUE_INHERITEDserver: Union[str, inherit] -> enums.VALUE_INHERITEDvirt_auto_boot: Union[bool, SETTINGS:virt_auto_boot] -> boolvirt_bridge: Union[str, SETTINGS:default_virt_bridge] -> strvirt_cpus: int -> Union[int, str]virt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver] -> enums.VirtDiskDriversvirt_file_size: Union[int, SETTINGS:default_virt_file_size] -> intvirt_ram: Union[int, SETTINGS:default_virt_ram] -> intvirt_type: Union[str, SETTINGS:default_virt_type] -> enums.VirtTypeboot_files: list/dict? -> enums.VALUE_INHERITEDfetchable_files: dict -> enums.VALUE_INHERITEDautoinstall_meta: dict -> enums.VALUE_INHERITEDkernel_options: dict -> enums.VALUE_INHERITEDkernel_options_post: dict -> enums.VALUE_INHERITEDmgmt_classes: list -> enums.VALUE_INHERITED
mgmt_parameters: Union[str, inherit] -> enums.VALUE_INHERITED
(
mgmt_classesparameter has a duplicate)
- V3.2.2:
No changes
- V3.2.1:
- Added:
kickstart: Resolves as a proxy toautoinstall
- V3.2.0:
No changes
- V3.1.2:
- Added:
filename: Union[str, inherit]
- V3.1.1:
No changes
- V3.1.0:
- Added:
get_arch()
- V3.0.1:
File was moved from
cobbler/item_profile.pytocobbler/items/profile.py.
- V3.0.0:
- Added:
next_server: Union[str, inherit]
- Changed:
Renamed:
kickstart->autoinstallRenamed:
ks_meta->autoinstall_metaautoinstall: Union[str, SETTINGS:default_kickstart] -> Union[str, SETTINGS:default_autoinstall]set_kickstart(): Renamed toset_autoinstall()
- Removed:
redhat_management_server: Union[str, inherit]template_remote_kickstarts: Union[bool, SETTINGS:template_remote_kickstarts]set_redhat_management_server()set_template_remote_kickstarts()
- V2.8.5:
Inital tracking of changes for the changelog.
- Added
ctime: intdepth: intmtime: intuid: strkickstart: Union[str, SETTINGS:default_kickstart]ks_meta: dictboot_files: list/dict?comment: strdhcp_tag: strdistro: strenable_gpxe: Union[bool, SETTINGS:enable_gpxe]enable_menu: Union[bool, SETTINGS:enable_menu]fetchable_files: dictkernel_options: dictkernel_options_post: dictmgmt_classes: listmgmt_parameters: Union[str, inherit]name: strname_servers: Union[list, SETTINGS:default_name_servers]name_servers_search: Union[list, SETTINGS:default_name_servers_search]owners: Union[list, SETTINGS:default_ownership]parent: strproxy: Union[str, SETTINGS:proxy_url_int]redhat_management_key: Union[str, inherit]redhat_management_server: Union[str, inherit]template_remote_kickstarts: Union[bool, SETTINGS:template_remote_kickstarts]repos: listserver: Union[str, inherit]template_files: dictvirt_auto_boot: Union[bool, SETTINGS:virt_auto_boot]virt_bridge: Union[str, SETTINGS:default_virt_bridge]virt_cpus: intvirt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver]virt_file_size: Union[int, SETTINGS:default_virt_file_size]virt_path: strvirt_ram: Union[int, SETTINGS:default_virt_ram]virt_type: Union[str, SETTINGS:default_virt_type]
- class cobbler.items.profile.Profile(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BootableItemA Cobbler profile object.
- COLLECTION_TYPE = 'profile'
- TYPE_NAME = 'profile'
- property arch: Archs | None
This represents the architecture of a profile. It is read only.
- Getter:
Noneor the parent architecture.
- property autoinstall: Template | None
Represents the automatic OS installation template object.
- Getter:
The template object that is configured.
- Setter:
The name, UID or Template object. This property may be set to
<<inherit>>.
- property boot_loaders: List[BootLoader]
This represents all boot loaders for which Cobbler will try to generate bootloader configuration for.
Note
This property can be set to
<<inherit>>.- Getter:
The bootloaders.
- Setter:
The new bootloaders. Will be validates against a list of well known ones.
- check_if_valid()[source]
Check if the profile is valid. This checks for an existing name and a distro as a conceptual parent.
- Raises:
CX – In case the distro or name is not present.
- property dhcp_tag: str
Represents the VLAN tag the DHCP Server is in/answering to.
- Getter:
The VLAN tag or nothing if a system with the profile should not be in a VLAN.
- Setter:
The new VLAN tag.
- property display_name: str
Returns the display name.
- Getter:
Returns the display name for the boot menu.
- Setter:
Sets the display name for the boot menu.
- property distro: Distro | None
The parent distro of a profile. This is not representing the Distro but the id of it.
This is a required property, if saved to the disk, with the exception if this is a subprofile.
- Returns:
The distro object or None.
- property dns: DNSOption
The DNS configuration option for this profile.
- Getter:
DNSOption object representing the profile’s DNS settings.
- property enable_ipxe: bool
Sets whether or not the profile will use iPXE for booting.
- Getter:
If set to inherit then this returns the parent value, otherwise it returns the real value.
- Setter:
May throw a
TypeErrorin case the new value cannot be cast tobool.
Sets whether or not the profile will be listed in the default PXE boot menu. This is pretty forgiving for YAML’s sake.
- Getter:
The value resolved from the defaults or the value specific to the profile.
- Setter:
May raise a
TypeErrorin case the boolean could not be converted.
- property filename: str
The filename which is fetched by the client from TFTP.
If the filename is set to
<<inherit>>and there is no parent profile then it will be set to an empty string.- Getter:
Either the default/inherited one, or the one specific to this profile.
- Setter:
The new filename which is fetched on boot. May raise a
TypeErrorwhen the wrong type was given.
- find_match_single_key(data: Dict[str, Any], key: str, value: Any, no_errors: bool = False) bool[source]
Look if the data matches or not. This is an alternative for
find_match().- Parameters:
data – The data to search through.
key – The key to look for int the item.
value – The value for the key.
no_errors – How strict this matching is.
- Returns:
Whether the data matches or not.
- make_clone()[source]
Clone this file object. Please manually adjust all value yourself to make the cloned object unique.
- Returns:
The cloned instance of this object.
Property to represent the menu which this image should be put into.
- Getter:
The uid of the menu or an emtpy str.
- Setter:
Should only be the uid of the menu not the object. May raise
CXin case the menu does not exist.
- property profile_groups: List[ProfileGroup]
Finds all ProfileGroups that this profile is a member of.
- property proxy: str
Override the default external proxy which is used for accessing the internet.
- Getter:
Returns the default one or the specific one for this repository.
- Setter:
May raise a
TypeErrorin case the wrong value is given.
- property redhat_management_key: str
Getter of the redhat management key of the profile or it’s parent.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the redhat_management_key of the profile.
- Setter:
May raise a
TypeErrorin case of a validation error.
- property redhat_management_org: str
Getter of the redhat management organization of the profile or it’s parent.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the redhat_management_org of the profile.
- Setter:
May raise a
TypeErrorin case of a validation error.
- property redhat_management_password: str
Getter of the redhat management password of the profile or it’s parent.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the redhat_management_password of the profile.
- Setter:
May raise a
TypeErrorin case of a validation error.
- property redhat_management_user: str
Getter of the redhat management user of the profile or it’s parent.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the redhat_management_user of the profile.
- Setter:
May raise a
TypeErrorin case of a validation error.
- property repos: str | List[str]
The repositories to add once the system is provisioned.
- Getter:
The names of the repositories the profile has assigned.
- Setter:
The new uids of the repositories for the profile. Validated against existing repositories.
- property server: str
Represents the hostname the Cobbler server is reachable by a client.
Note
This property can be set to
<<inherit>>.- Getter:
The hostname of the Cobbler server.
- Setter:
May raise a
TypeErrorin case the new value is not astr.
- property tftp: TFTPOption
The TFTPOption instance associated with this profile.
- Getter:
TFTPOption object representing the configuration for network booting.
- property virt: VirtOption
Property for the VirtOptions.
- Getter:
The VirtOptions of the Profile.
7.1.6.9. cobbler.items.profile_group module
ProfileGroup class for grouping profiles.
7.1.6.10. cobbler.items.repo module
Cobbler module that contains the code for a Cobbler repo object.
Changelog:
- V3.4.0 (unreleased):
- Changed:
Constructor:
kwargscan now be used to seed the item during creation.children: The property was moved to the base class.from_dict(): The method was moved to the base class.
- V3.3.4 (unreleased):
No changes
- V3.3.3:
No changes
- V3.3.2:
No changes
- V3.3.1:
No changes
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
os_version: str
from_dict()
- Moved to base class (Item):
ctime: floatdepth: floatmtime: floatparent: struid: strcomment: strname: strowners: Union[list, SETTINGS:default_ownership]
- Changes:
breed: str -> enums.RepoBreedsarch: str -> enums.RepoArchsrsyncopts: dict/str? -> dictmirror_type: str -> enums.MirrorTypeapt_components: list/str? -> listapt_dists: list/str? -> listcreaterepo_flags: Union[dict, inherit] -> enums.VALUE_INHERITEDproxy: Union[str, inherit] -> enums.VALUE_INHERITED
- V3.2.2:
No changes
- V3.2.1:
- Added:
mirror_type: strset_mirror_type()
- V3.2.0:
- Added:
rsyncopts: dict/strset_rsyncopts()
- V3.1.2:
No changes
- V3.1.1:
No changes
- V3.1.0:
- Changed:
arch: New valid values390xas an architecture.
- V3.0.1:
File was moved from
cobbler/item_repo.pytocobbler/items/repo.py.
- V3.0.0:
- Changes:
proxy: Union[str, inherit, SETTINGS:proxy_url_ext] -> Union[str, inherit]
- V2.8.5:
Inital tracking of changes for the changelog.
- Added:
ctime: floatdepth: floatmtime: floatparent: struid: strapt_components: list/str?apt_dists: list/str?arch: strbreed: strcomment: strcreaterepo_flags: Union[dict, inherit]environment: dictkeep_updated: boolmirror: strmirror_locally: boolname: strowners: Union[list, SETTINGS:default_ownership]priority: intproxy: Union[str, inherit, SETTINGS:proxy_url_ext]rpm_list: listyumopts: dict
- class cobbler.items.repo.Repo(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BootableItemA Cobbler repo object.
- COLLECTION_TYPE = 'repo'
- TYPE_NAME = 'repo'
- property apt: APTOption
The APTOption instance associated with a Repo.
- Getter:
Returns the current APTOption instance.
- property arch: RepoArchs
Override the arch used for reposync
- Getter:
The repo arch enum object.
- Setter:
May throw a
ValueErrororTypeErrorin case the conversion of the value is unsuccessful.
- property breed: RepoBreeds
The repository system breed. This decides some defaults for most actions with a repo in Cobbler.
- Getter:
The breed detected.
- Setter:
May raise a
ValueErrororTypeErrorin case the given value is wrong.
- check_if_valid() None[source]
Checks if the object is valid. Currently checks for name and mirror to be present.
- Raises:
CX – In case the name or mirror is missing.
- property createrepo_flags: str
Flags passed to createrepo when it is called. Common flags to use would be
-c cacheor-g comps.xmlto generate group information.Note
This property can be set to
<<inherit>>.- Getter:
The createrepo_flags to apply to the repo.
- Setter:
The new flags. May raise a
TypeErrorin case the options are not astr.
- property environment: Dict[Any, Any]
Yum can take options from the environment. This puts them there before each reposync.
- Getter:
The options to be attached to the environment.
- Setter:
May raise a
ValueErrorin case the data provided is not parsable.
- property keep_updated: bool
This allows the user to disable updates to a particular repo for whatever reason.
- Getter:
True in case the repo is updated automatically and False otherwise.
- Setter:
Is auto-converted to a bool via multiple types. Raises a
TypeErrorif this was not possible.
- make_clone() Repo[source]
Clone this file object. Please manually adjust all value yourself to make the cloned object unique.
- Returns:
The cloned instance of this object.
- property mirror: str
A repo is (initially, as in right now) is something that can be rsynced. reposync/repotrack integration over HTTP might come later.
- Getter:
The mirror uri.
- Setter:
May raise a
TypeErrorin case we run into
- property mirror_locally: bool
If this property is set to
Truethen all content of the source is mirrored locally. This may take up a lot of disk space.- Getter:
Whether the mirror is locally available or not.
- Setter:
Raises a
TypeErrorin case after the conversion of the value is not of typebool.
- property mirror_type: MirrorType
Override the mirror_type used for reposync
- Getter:
The mirror type. Is one of the predefined ones.
- Setter:
Hand over a str or enum type value to this. May raise
TypeErrororValueErrorin case there are conversion or type problems.
- property os_version: str
The operating system version which is compatible with this repository.
- Getter:
The os version.
- Setter:
The version as a
str.
- property priority: int
Set the priority of the repository. Only works if host is using priorities plugin for yum.
- Getter:
The priority of the repo.
- Setter:
A number between 1 & 99. May raise otherwise
TypeErrororValueError.
- property proxy: str
Override the default external proxy which is used for accessing the internet.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the default one or the specific one for this repository.
- Setter:
May raise a
TypeErrorin case the wrong value is given.
- property rpm_list: List[str]
Rather than mirroring the entire contents of a repository (Fedora Extras, for instance, contains games, and we probably don’t want those), make it possible to list the packages one wants out of those repos, so only those packages and deps can be mirrored.
- Getter:
The list of packages to be mirrored.
- Setter:
May be a space delimited list or a real one.
7.1.6.11. cobbler.items.system module
All code belonging to Cobbler systems.
Changelog (System):
- V3.4.0 (unreleased):
- Added:
display_name: strredhat_management_org: enums.VALUE_INHERITEDredhat_management_user: enums.VALUE_INHERITEDredhat_management_password: enums.VALUE_INHERITED
- Changes:
Constructor:
kwargscan now be used to seed the item during creation.from_dict(): The method was moved to the base class.parent: The property was moved to the base class.
- V3.3.4 (unreleased):
- Changed:
The network interface
defaultis not created on object creation.
- V3.3.3:
- Changed:
boot_loaders: Can now be set to<<inherit>>next_server_v4: Can now be set to<<inhertit>>next_server_v6: Can now be set to<<inhertit>>virt_cpus: Can now be set to<<inhertit>>virt_file_size: Can now be set to<<inhertit>>virt_disk_driver: Can now be set to<<inhertit>>virt_auto_boot: Can now be set to<<inhertit>>virt_ram: Can now be set to<<inhertit>>virt_type: Can now be set to<<inhertit>>virt_path: Can now be set to<<inhertit>>
- V3.3.2:
No changes
- V3.3.1:
- Changed:
serial_device: Default value is now-1
- V3.3.0:
This release switched from pure attributes to properties (getters/setters).
- Added:
next_server_v4next_server_v6
- Changed:
virt_*: Cannot be set to inherit anymoreenable_gpxe: Renamed toenable_ipxe
- Removed:
get_fields()next_server- Please use one ofnext_server_v4ornext_server_v6set_boot_loader()- Moved toboot_loaderpropertyset_server()- Moved toserverpropertyset_next_server()- Moved tonext_serverpropertyset_filename()- Moved tofilenamepropertyset_proxy()- Moved toproxypropertyset_redhat_management_key()- Moved toredhat_management_keypropertyget_redhat_management_key()- Moved toredhat_management_keypropertyset_dhcp_tag()- Moved toNetworkInterfaceclass propertydhcp_tagset_cnames()- Moved toNetworkInterfaceclass propertycnamesset_status()- Moved tostatuspropertyset_static()- Moved toNetworkInterfaceclass propertystaticset_management()- Moved toNetworkInterfaceclass propertymanagementset_dns_name()- Moved toNetworkInterfaceclass propertydns_nameset_hostname()- Moved tohostnamepropertyset_ip_address()- Moved toNetworkInterfaceclass propertyip_addressset_mac_address()- Moved toNetworkInterfaceclass propertymac_addressset_gateway()- Moved togatewaypropertyset_name_servers()- Moved toname_serverspropertyset_name_servers_search()- Moved toname_servers_searchpropertyset_netmask()- Moved toNetworkInterfaceclass propertynetmaskset_if_gateway()- Moved toNetworkInterfaceclass propertyif_gatewayset_virt_bridge()- Moved toNetworkInterfaceclass propertyvirt_bridgeset_interface_type()- Moved toNetworkInterfaceclass propertyinterface_typeset_interface_master()- Moved toNetworkInterfaceclass propertyinterface_masterset_bonding_opts()- Moved toNetworkInterfaceclass propertybonding_optsset_bridge_opts()- Moved toNetworkInterfaceclass propertybridge_optsset_ipv6_autoconfiguration()- Moved toipv6_autoconfigurationpropertyset_ipv6_default_device()- Moved toipv6_default_devicepropertyset_ipv6_address()- Moved toNetworkInterfaceclass propertyipv6_addressset_ipv6_prefix()- Moved toNetworkInterfaceclass propertyipv6_prefixset_ipv6_secondaries()- Moved toNetworkInterfaceclass propertyipv6_secondariesset_ipv6_default_gateway()- Moved toNetworkInterfaceclass propertyipv6_default_gatewayset_ipv6_static_routes()- Moved toNetworkInterfaceclass propertyipv6_static_routesset_ipv6_mtu()- Moved toNetworkInterfaceclass propertyipv6_mtuset_mtu()- Moved toNetworkInterfaceclass propertymtuset_connected_mode()- Moved toNetworkInterfaceclass propertyconnected_modeset_enable_gpxe()- Moved toenable_gpxepropertyset_profile()- Moved toprofilepropertyset_image()- Moved toimagepropertyset_virt_cpus()- Moved tovirt_cpuspropertyset_virt_file_size()- Moved tovirt_file_sizepropertyset_virt_disk_driver()- Moved tovirt_disk_driverpropertyset_virt_auto_boot()- Moved tovirt_auto_bootpropertyset_virt_pxe_boot()- Moved tovirt_pxe_bootpropertyset_virt_ram()- Moved tovirt_rampropertyset_virt_type()- Moved tovirt_typepropertyset_virt_path()- Moved tovirt_pathpropertyset_netboot_enabled()- Moved tonetboot_enabledpropertyset_autoinstall()- Moved toautoinstallpropertyset_power_type()- Moved topower_typepropertyset_power_identity_file()- Moved topower_identity_filepropertyset_power_options()- Moved topower_optionspropertyset_power_user()- Moved topower_userpropertyset_power_pass()- Moved topower_passpropertyset_power_address()- Moved topower_addresspropertyset_power_id()- Moved topower_idpropertyset_repos_enabled()- Moved torepos_enabledpropertyset_serial_device()- Moved toserial_devicepropertyset_serial_baud_rate()- Moved toserial_baud_rateproperty
- V3.2.2:
No changes
- V3.2.1:
- Added:
kickstart: Resolves as a proxy toautoinstall
- V3.2.0:
No changes
- V3.1.2:
- Added:
filename: str - Inheritableset_filename()
- V3.1.1:
No changes
- V3.1.0:
No changes
- V3.0.1:
File was moved from
cobbler/item_system.pytocobbler/items/system.py.
- V3.0.0:
Field definitions for network interfaces moved to own
FIELDSarray- Added:
boot_loader: str - Inheritablenext_server: str - Inheritablepower_options: strpower_identity_file: strserial_device: intserial_baud_rate: int - One of “”, “2400”, “4800”, “9600”, “19200”, “38400”, “57600”, “115200”set_next_server()set_serial_device()set_serial_baud_rate()get_config_filename()set_power_identity_file()set_power_options()
- Changed:
kickstart: Renamed toautoinstallks_meta: Renamed toautoinstall_metafrom_datastruct: Renamed tofrom_dict()set_kickstart(): Renamed toset_autoinstall()
- Removed:
redhat_management_serverset_ldap_enabled()set_monit_enabled()set_template_remote_kickstarts()set_redhat_management_server()set_name()
- V2.8.5:
Inital tracking of changes for the changelog.
Network interface defintions part of this class
- Added:
name: struid: strowners: List[str] - Inheritableprofile: str - Name of the profileimage: str - Name of the imagestatus: str - One of “”, “development”, “testing”, “acceptance”, “production”kernel_options: Dict[str, Any]kernel_options_post: Dict[str, Any]ks_meta: Dict[str, Any]enable_gpxe: bool - Inheritableproxy: str - Inheritablenetboot_enabled: boolkickstart: str - Inheritablecomment: strdepth: intserver: str - Inheritablevirt_path: str - Inheritablevirt_type: str - Inheritable; One of “xenpv”, “xenfv”, “qemu”, “kvm”, “vmware”, “openvz”virt_cpus: int - Inheritablevirt_file_size: float - Inheritablevirt_disk_driver: str - Inheritable; One of “<<inherit>>”, “raw”, “qcow”, “qcow2”, “aio”, “vmdk”, “qed”virt_ram: int - Inheritablevirt_auto_boot: bool - Inheritablevirt_pxe_boot: boolctime: floatmtime: floatpower_type: str - Default loaded from settings keypower_management_default_typepower_address: strpower_user: strpower_pass: strpower_id: strhostname: strgateway: strname_servers: List[str]name_servers_search: List[str]ipv6_default_device: stripv6_autoconfiguration: boolmgmt_classes: List[Any] - Inheritablemgmt_parameters: str - Inheritableboot_files: Dict[str, Any]/List (Not reverse engineeriable) - Inheritablefetchable_files: Dict[str, Any] - Inheritabletemplate_files: Dict[str, Any] - Inheritableredhat_management_key: str - Inheritableredhat_management_server: str - Inheritabletemplate_remote_kickstarts: bool - Default loaded from settings keytemplate_remote_kickstartsrepos_enabled: boolldap_enabled: - boolldap_type: str - Default loaded from settings keyldap_management_default_typemonit_enabled: bool
- class cobbler.items.system.System(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BootableItemA Cobbler system object.
- COLLECTION_TYPE = 'system'
- TYPE_NAME = 'system'
- property autoinstall: Template | None
Represents the automatic OS installation template object.
- Getter:
The template object that is configured.
- Setter:
The name, UID or Template object. This property may be set to
<<inherit>>.
- property boot_loaders: List[BootLoader]
boot_loaders property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
boot_loaders.- Setter:
Sets the value for the property
boot_loaders.
- check_if_valid()[source]
Checks if the current item passes logical validation.
- Raises:
CX – In case name is missing. Additionally either image or profile is required.
- property display_name: str
Returns the display name.
- Getter:
Returns the display name for the boot menu.
- Setter:
Sets the display name for the boot menu.
- property enable_ipxe: bool
enable_ipxe property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
enable_ipxe.- Setter:
Sets the value for the property
enable_ipxe.
- property filename: str
filename property.
- Getter:
Returns the value for
filename.- Setter:
Sets the value for the property
filename.
- property gateway
gateway property.
- Getter:
Returns the value for
gateway.- Setter:
Sets the value for the property
gateway.
- get_config_filename(interface: str, loader: BootLoader | None = None) str | None[source]
The configuration file for each system pxe uses is either a form of the MAC address or the hex version or the IP address. 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.
- Parameters:
interface – Name of the interface.
loader – Bootloader type.
- get_ip_address(interface: str) str[source]
Get the IP address for the given interface.
- Parameters:
interface – The name of the interface to get the IP address of.
- get_mac_address(interface: str = 'default')[source]
Get the mac address, which may be implicit in the object name or explicit with –mac-address. Use the explicit location first.
- Parameters:
interface – The name of the interface to get the MAC of.
- property hostname: str
hostname property.
- Getter:
Returns the value for
hostname.- Setter:
Sets the value for the property
hostname.
- property image: str
image property.
- Getter:
Returns the value for
image.- Setter:
Sets the value for the property
image.
- property interfaces: Dict[str, NetworkInterface]
Represents all interfaces owned by the system.
- Getter:
The interfaces present. Has at least the
defaultone.- Setter:
Accepts not only the correct type but also a dict with dicts which will then be converted by the setter.
- property ipv6_autoconfiguration: bool
ipv6_autoconfiguration property.
- Getter:
Returns the value for
ipv6_autoconfiguration.- Setter:
Sets the value for the property
ipv6_autoconfiguration.
- property ipv6_default_device: str
ipv6_default_device property.
- Getter:
Returns the value for
ipv6_default_device.- Setter:
Sets the value for the property
ipv6_default_device.
- is_management_supported(cidr_ok: bool = True) bool[source]
Can only add system PXE records if a MAC or IP address is available, else it’s a koan only record.
- Parameters:
cidr_ok – Deprecated parameter which is not used anymore.
- property netboot_enabled: bool
netboot_enabled property.
- Getter:
Returns the value for
netboot_enabled.- Setter:
Sets the value for the property
netboot_enabled.
- property power: PowerOption
Property for the PowerOptions.
- Getter:
The PowerOptions of the System.
- property profile: str
profile property.
- Getter:
Returns the value for
profile.- Setter:
Sets the value for the property
profile.
- property proxy: str
proxy property. This corresponds per default to the setting``proxy_url_int``.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
proxy.- Setter:
Sets the value for the property
proxy.
- property redhat_management_key: str
redhat_management_key property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
redhat_management_key.- Setter:
Sets the value for the property
redhat_management_key.
- property redhat_management_org: str
redhat_management_org property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
redhat_management_org.- Setter:
Sets the value for the property
redhat_management_org.
- property redhat_management_password: str
redhat_management_password property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
redhat_management_password.- Setter:
Sets the value for the property
redhat_management_password.
- property redhat_management_user: str
redhat_management_user property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
redhat_management_user.- Setter:
Sets the value for the property
redhat_management_user.
- property repos_enabled: bool
repos_enabled property.
- Getter:
Returns the value for
repos_enabled.- Setter:
Sets the value for the property
repos_enabled.
- property serial_baud_rate: BaudRates
serial_baud_rate property. The value “disabled” will disable the functionality completely.
- Getter:
Returns the value for
serial_baud_rate.- Setter:
Sets the value for the property
serial_baud_rate.
- property serial_device: int
serial_device property. “-1” disables the serial device functionality completely.
- Getter:
Returns the value for
serial_device.- Setter:
Sets the value for the property
serial_device.
- property server: str
server property.
Note
This property can be set to
<<inherit>>.- Getter:
Returns the value for
server.- Setter:
Sets the value for the property
server.
- property status: str
status property.
- Getter:
Returns the value for
status.- Setter:
Sets the value for the property
status.
- property system_groups: List[SystemGroup]
Finds all SystemGroups that this system is a member of.
- property tftp: TFTPOption
Property for the TFTPOptions.
- Getter:
The TFTPOptions of the System.
- property virt: VirtOption
Property for the VirtOptions.
- Getter:
The VirtOptions of the System.
7.1.6.12. cobbler.items.system_group module
SystemGroup class for grouping systems.
7.1.6.13. cobbler.items.template module
All code blonging to Cobbler Templates.
Changelog:
- V3.4.0 (unrelased):
Initial add of datatype.
- class cobbler.items.template.Template(api: CobblerAPI, *args: Any, **kwargs: Any)[source]
Bases:
BaseItemA Cobbler template object.
- COLLECTION_TYPE = 'template'
- TYPE_NAME = 'template'
- property built_in: bool
Property that represents if a template is built-in or not.
If a template is built-in it is not persisted to disk and none of it effectively becomes read-only.
- Getter:
Returns True if the template is built-in.
- property content: str
Property for the content of the template.
- Getter:
Returns a cached version of the template content.
- Setter:
In case a supported template type is set this will write the given content to the target URI.
- refresh_content() bool[source]
Reads the template from the currently set uri and caches it in-memory. In case a given URI is unavailable, the old template content is kept and a message is written to the log.
- Returns:
If reading the template was successful.
- property tags: Set[str]
Property that represents the set of tags a template has. A tag can be any string, there are however strings with special meanings that means that a template is used for a special purpose inside of Cobbler.
- Getter:
Returns the current Set of tags.
- Setter:
Sets the new value for the tags property.
7.1.6.14. Module contents
This package contains all data storage classes. The classes are responsible for ensuring that types of the properties are correct but not for logical checks. The classes should be as stupid as possible. Further they are responsible for returning the logic for serializing and deserializing themselves.
Cobbler has a concept of inheritance where an attribute/a property may have the value <<inherit>>. This then takes
over the value of the parent item with the exception of dictionaries. Values that are of type dict are always
implicitly inherited, to remove a key-value pair from the dictionary in the inheritance chain prefix the key with !.