7.1.6. cobbler.items package

7.1.6.1. Subpackages

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_INHERITED

    • redhat_management_user: enums.VALUE_INHERITED

    • redhat_management_password: enums.VALUE_INHERITED

  • Changed:
    • Constructor: kwargs can 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: float

    • depth: int

    • mtime: float

    • uid: str

    • kernel_options: dict

    • kernel_options_post: dict

    • autoinstall_meta: dict

    • boot_files: list/dict

    • template_files: list/dict

    • comment: str

    • name: str

    • owners: list[str]

  • Changed:
    • tree_build_time: str -> float

    • arch: str -> Union[list, str]

    • fetchable_files: list/dict? -> dict

    • boot_loader -> boot_loaders (rename)

  • Removed:
    • get_fields()

    • get_parent

    • set_kernel() - Please use the property kernel

    • set_remote_boot_kernel() - Please use the property remote_boot_kernel

    • set_tree_build_time() - Please use the property tree_build_time

    • set_breed() - Please use the property breed

    • set_os_version() - Please use the property os_version

    • set_initrd() - Please use the property initrd

    • set_remote_boot_initrd() - Please use the property remote_boot_initrd

    • set_source_repos() - Please use the property source_repos

    • set_arch() - Please use the property arch

    • get_arch() - Please use the property arch

    • set_supported_boot_loaders() - Please use the property supported_boot_loaders. It is readonly.

    • set_boot_loader() - Please use the property boot_loader

    • set_redhat_management_key() - Please use the property redhat_management_key

    • get_redhat_management_key() - Please use the property redhat_management_key

V3.2.2:
  • No changes

V3.2.1:
  • Added:
    • kickstart: Resolves as a proxy to autoinstall

V3.2.0:
  • No changes

V3.1.2:
  • Added:
    • remote_boot_kernel: str

    • remote_grub_kernel: str

    • remote_boot_initrd: str

    • remote_grub_initrd: str

V3.1.1:
  • No changes

V3.1.0:
  • Added:
    • get_arch()

V3.0.1:
  • File was moved from cobbler/item_distro.py to cobbler/items/distro.py.

V3.0.0:
  • Added:
    • boot_loader: Union[str, inherit]

  • Changed:
    • rename: ks_meta -> autoinstall_meta

    • redhat_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: str

    • ctime: float

    • mtime: float

    • uid: str

    • owners: Union[list, SETTINGS:default_ownership]

    • kernel: str

    • initrd: str

    • kernel_options: dict

    • kernel_options_post: dict

    • ks_meta: dict

    • arch: str

    • breed: str

    • os_version: str

    • source_repos: list

    • depth: int

    • comment: str

    • tree_build_time: str

    • mgmt_classes: list

    • boot_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: BootableItem

A 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 TypeError or ValueError in 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 ValueError or TypeError in case the given value is wrong.

check_if_valid()[source]

Check if a distro object is valid. If invalid an exception is raised.

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_mirror directory. 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 TypeError or ValueError in 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 ValueError or TypeError in case of validation errors.

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 TypeError or ValueError in 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 TypeError or ValueError in case the provided value was not correct.

property remote_grub_initrd: str

This is tied to the remote_boot_initrd property. 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_kernel property. 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 import only.

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.

property tree_build_time: float

Represents the import time of the distro. If not imported, this field is not meaningful.

Getter:

Setter:

7.1.6.4. cobbler.items.distro_group module

DistroGroup class for grouping distros.

class cobbler.items.distro_group.DistroGroup(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: ItemGroup

DistroGroup class

COLLECTION_TYPE = 'distro_group'
TYPE_NAME = 'distro_group'
make_clone() BaseItem[source]

Clone this distro group

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: kwargs can 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 again

    • boot_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: list

    • menu: str

    • supported_boot_loaders: list

    • from_dict()

  • Moved to parent class (Item):
    • ctime: float

    • mtime: float

    • depth: int

    • parent: str

    • uid: str

    • comment: str

    • name: str

  • Removed:
    • get_fields()

    • get_parent()

    • set_arch() - Please use the arch property.

    • set_autoinstall() - Please use the autoinstall property.

    • set_file() - Please use the file property.

    • set_os_version() - Please use the os_version property.

    • set_breed() - Please use the breed property.

    • set_image_type() - Please use the image_type property.

    • set_virt_cpus() - Please use the virt_cpus property.

    • set_network_count() - Please use the network_count property.

    • set_virt_auto_boot() - Please use the virt_auto_boot property.

    • set_virt_file_size() - Please use the virt_file_size property.

    • set_virt_disk_driver() - Please use the virt_disk_driver property.

    • set_virt_ram() - Please use the virt_ram property.

    • set_virt_type() - Please use the virt_type property.

    • set_virt_bridge() - Please use the virt_bridge property.

    • set_virt_path() - Please use the virt_path property.

    • get_valid_image_types()

  • Changes:
    • arch: str -> enums.Archs

    • autoinstall: str -> enums.VALUE_INHERITED

    • image_type: str -> enums.ImageTypes

    • virt_auto_boot: Union[bool, SETTINGS:virt_auto_boot] -> bool

    • virt_bridge: Union[str, SETTINGS:default_virt_bridge] -> str

    • virt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver] -> enums.VirtDiskDrivers

    • virt_file_size: Union[float, SETTINGS:default_virt_file_size] -> float

    • virt_ram: Union[int, SETTINGS:default_virt_ram] -> int

    • virt_type: Union[str, SETTINGS:default_virt_type] -> enums.VirtType

V3.2.2:
  • No changes

V3.2.1:
  • Added:
    • kickstart: Resolves as a proxy to autoinstall

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 use set_autoinstall()

V2.8.5:
  • Inital tracking of changes for the changelog.

  • Added:
    • ctime: float

    • depth: int

    • mtime: float

    • parent: str

    • uid: str

    • arch: str

    • kickstart: str

    • breed: str

    • comment: str

    • file: str

    • image_type: str

    • name: str

    • network_count: int

    • os_version: str

    • owners: Union[list, SETTINGS:default_ownership]

    • virt_auto_boot: Union[bool, SETTINGS:virt_auto_boot]

    • virt_bridge: Union[str, SETTINGS:default_virt_bridge]

    • virt_cpus: int

    • virt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver]

    • virt_file_size: Union[float, SETTINGS:default_virt_file_size]

    • virt_path: str

    • virt_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: BootableItem

A 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.json file.

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 menu: str

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 CX in 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 TypeError in 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.6. cobbler.items.menu module

Cobbler module that contains the code for a Cobbler menu object.

Changelog:

V3.4.0 (unreleased):
  • Changes:
    • Constructor: kwargs can 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.

V3.3.4 (unreleased):
  • No changes

V3.3.3:
  • Changed:
    • check_if_valid(): Now present in base class.

V3.3.2:
  • No changes

V3.3.1:
  • No changes

V3.3.0:
  • Inital version of the item type.

  • Added:
    • display_name: str

class cobbler.items.menu.Menu(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: BootableItem

A Cobbler menu object.

COLLECTION_TYPE = 'menu'
TYPE_NAME = 'menu'
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.

make_clone() Menu[source]

Clone this file object. Please manually adjust all value yourself to make the cloned object unique.

Returns:

The cloned instance of this object.

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: kwargs can 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 parameter resolved

    • virt_bridge: Can now be set to <<inherit>> to get its value from the settings key default_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:
    • NetworkInterface is 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 System class

V2.8.5:
  • Initial tracking of changes for the changelog.

  • Field definitions part of System class

  • Added:
    • mac_address: str

    • connected_mode: bool

    • mtu: str

    • ip_address: str

    • interface_type: str - One of “na”, “bond”, “bond_slave”, “bridge”, bridge_slave”, “bonded_bridge_slave”, “infiniband”

    • interface_master: str

    • bonding_opts: str

    • bridge_opts: str

    • management: bool

    • static: bool

    • netmask: str

    • if_gateway: str

    • dhcp_tag: str

    • dns_name: str

    • static_routes: List[str]

    • virt_bridge: str

    • ipv6_address: str

    • ipv6_prefix: str

    • ipv6_secondaries: List[str]

    • ipv6_mtu: str

    • ipv6_static_routes: List[str]

    • ipv6_default_gateway: str

    • cnames: List[str]

class cobbler.items.network_interface.NetworkInterface(api: CobblerAPI, system_uid: str, *args: Any, **kwargs: Any)[source]

Bases: BaseItem

A 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: System

Return the system the network interface belongs to.

property system_name: str

system_name property.

Getter:

Returns the value for system_name.

Setter:

Sets the value for the property system_name.

property system_uid: str

system_uid property.

Getter:

Returns the value for system_uid.

Setter:

Sets the value for the property system_uid.

property virt_bridge: str

virt_bridge property. If set to <<inherit>> this will read the value from the setting “default_virt_bridge”.

Getter:

Returns the value for virt_bridge.

Setter:

Sets the value for the property virt_bridge.

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: kwargs can 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_INHERITED

    • redhat_management_user: enums.VALUE_INHERITED

    • redhat_management_password: enums.VALUE_INHERITED

V3.3.4 (unreleased):
  • No changes

V3.3.3:
  • Changed:
    • next_server_v4: str -> enums.VALUE_INHERITED

    • next_server_v6: str -> enums.VALUE_INHERITED

    • virt_bridge: str -> enums.VALUE_INHERITED

    • virt_file_size: int -> enums.VALUE_INHERITED

    • virt_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: bool

    • next_server_v4: str

    • next_server_v6: str

    • menu: str

    • from_dict()

  • Removed:
    • enable_gpxe: Union[bool, SETTINGS:enable_gpxe]

    • next_server: Union[str, inherit]

    • get_fields()

    • get_parent(): Please use the property parent instead

    • set_parent(): Please use the property parent instead

    • set_distro(): Please use the property distro instead

    • set_name_servers(): Please use the property name_servers instead

    • set_name_servers_search(): Please use the property name_servers_search instead

    • set_proxy(): Please use the property proxy instead

    • set_enable_gpxe(): Please use the property enable_gpxe instead

    • set_enable_menu(): Please use the property enable_menu instead

    • set_dhcp_tag(): Please use the property dhcp_tag instead

    • set_server(): Please use the property server instead

    • set_next_server(): Please use the property next_server instead

    • set_filename(): Please use the property filename instead

    • set_autoinstall(): Please use the property autoinstall instead

    • set_virt_auto_boot(): Please use the property virt_auto_boot instead

    • set_virt_cpus(): Please use the property virt_cpus instead

    • set_virt_file_size(): Please use the property virt_file_size instead

    • set_virt_disk_driver(): Please use the property virt_disk_driver instead

    • set_virt_ram(): Please use the property virt_ram instead

    • set_virt_type(): Please use the property virt_type instead

    • set_virt_bridge(): Please use the property virt_bridge instead

    • set_virt_path(): Please use the property virt_path instead

    • set_repos(): Please use the property repos instead

    • set_redhat_management_key(): Please use the property redhat_management_key instead

    • get_redhat_management_key(): Please use the property redhat_management_key instead

    • get_arch(): Please use the property arch instead

  • Changed:
    • autoinstall: Union[str, SETTINGS:default_kickstart] -> enums.VALUE_INHERITED

    • enable_menu: Union[bool, SETTINGS:enable_menu] -> bool

    • name_servers: Union[list, SETTINGS:default_name_servers] -> list

    • name_servers_search: Union[list, SETTINGS:default_name_servers_search] -> list

    • filename: Union[str, inherit] -> str

    • proxy: Union[str, SETTINGS:proxy_url_int] -> enums.VALUE_INHERITED

    • redhat_management_key: Union[str, inherit] -> enums.VALUE_INHERITED

    • server: Union[str, inherit] -> enums.VALUE_INHERITED

    • virt_auto_boot: Union[bool, SETTINGS:virt_auto_boot] -> bool

    • virt_bridge: Union[str, SETTINGS:default_virt_bridge] -> str

    • virt_cpus: int -> Union[int, str]

    • virt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver] -> enums.VirtDiskDrivers

    • virt_file_size: Union[int, SETTINGS:default_virt_file_size] -> int

    • virt_ram: Union[int, SETTINGS:default_virt_ram] -> int

    • virt_type: Union[str, SETTINGS:default_virt_type] -> enums.VirtType

    • boot_files: list/dict? -> enums.VALUE_INHERITED

    • fetchable_files: dict -> enums.VALUE_INHERITED

    • autoinstall_meta: dict -> enums.VALUE_INHERITED

    • kernel_options: dict -> enums.VALUE_INHERITED

    • kernel_options_post: dict -> enums.VALUE_INHERITED

    • mgmt_classes: list -> enums.VALUE_INHERITED

    • mgmt_parameters: Union[str, inherit] -> enums.VALUE_INHERITED

    (mgmt_classes parameter has a duplicate)

V3.2.2:
  • No changes

V3.2.1:
  • Added:
    • kickstart: Resolves as a proxy to autoinstall

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.py to cobbler/items/profile.py.

V3.0.0:
  • Added:
    • next_server: Union[str, inherit]

  • Changed:
    • Renamed: kickstart -> autoinstall

    • Renamed: ks_meta -> autoinstall_meta

    • autoinstall: Union[str, SETTINGS:default_kickstart] -> Union[str, SETTINGS:default_autoinstall]

    • set_kickstart(): Renamed to set_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: int

    • depth: int

    • mtime: int

    • uid: str

    • kickstart: Union[str, SETTINGS:default_kickstart]

    • ks_meta: dict

    • boot_files: list/dict?

    • comment: str

    • dhcp_tag: str

    • distro: str

    • enable_gpxe: Union[bool, SETTINGS:enable_gpxe]

    • enable_menu: Union[bool, SETTINGS:enable_menu]

    • fetchable_files: dict

    • kernel_options: dict

    • kernel_options_post: dict

    • mgmt_classes: list

    • mgmt_parameters: Union[str, inherit]

    • name: str

    • name_servers: Union[list, SETTINGS:default_name_servers]

    • name_servers_search: Union[list, SETTINGS:default_name_servers_search]

    • owners: Union[list, SETTINGS:default_ownership]

    • parent: str

    • proxy: 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: list

    • server: Union[str, inherit]

    • template_files: dict

    • virt_auto_boot: Union[bool, SETTINGS:virt_auto_boot]

    • virt_bridge: Union[str, SETTINGS:default_virt_bridge]

    • virt_cpus: int

    • virt_disk_driver: Union[str, SETTINGS:default_virt_disk_driver]

    • virt_file_size: Union[int, SETTINGS:default_virt_file_size]

    • virt_path: str

    • virt_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: BootableItem

A 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:

None or 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 TypeError in case the new value cannot be cast to bool.

property enable_menu: bool

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 TypeError in 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 TypeError when 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 menu: str

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 CX in 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 TypeError in 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 TypeError in 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 TypeError in 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 TypeError in 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 TypeError in 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 TypeError in case the new value is not a str.

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.

property virt_bridge: str

Represents the name of the virtual bridge to use.

Note

This property can be set to <<inherit>>.

Getter:

Either the default name for the bridge or the specific one for this profile.

Setter:

The new name. Does not overwrite the default one.

7.1.6.9. cobbler.items.profile_group module

ProfileGroup class for grouping profiles.

class cobbler.items.profile_group.ProfileGroup(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: ItemGroup

ProfileGroup class

COLLECTION_TYPE = 'profile_group'
TYPE_NAME = 'profile_group'
make_clone() BaseItem[source]

Clone this profile group

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: kwargs can 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: float

    • depth: float

    • mtime: float

    • parent: str

    • uid: str

    • comment: str

    • name: str

    • owners: Union[list, SETTINGS:default_ownership]

  • Changes:
    • breed: str -> enums.RepoBreeds

    • arch: str -> enums.RepoArchs

    • rsyncopts: dict/str? -> dict

    • mirror_type: str -> enums.MirrorType

    • apt_components: list/str? -> list

    • apt_dists: list/str? -> list

    • createrepo_flags: Union[dict, inherit] -> enums.VALUE_INHERITED

    • proxy: Union[str, inherit] -> enums.VALUE_INHERITED

V3.2.2:
  • No changes

V3.2.1:
  • Added:
    • mirror_type: str

    • set_mirror_type()

V3.2.0:
  • Added:
    • rsyncopts: dict/str

    • set_rsyncopts()

V3.1.2:
  • No changes

V3.1.1:
  • No changes

V3.1.0:
  • Changed:
    • arch: New valid value s390x as an architecture.

V3.0.1:
  • File was moved from cobbler/item_repo.py to cobbler/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: float

    • depth: float

    • mtime: float

    • parent: str

    • uid: str

    • apt_components: list/str?

    • apt_dists: list/str?

    • arch: str

    • breed: str

    • comment: str

    • createrepo_flags: Union[dict, inherit]

    • environment: dict

    • keep_updated: bool

    • mirror: str

    • mirror_locally: bool

    • name: str

    • owners: Union[list, SETTINGS:default_ownership]

    • priority: int

    • proxy: Union[str, inherit, SETTINGS:proxy_url_ext]

    • rpm_list: list

    • yumopts: dict

class cobbler.items.repo.Repo(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: BootableItem

A 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 ValueError or TypeError in 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 ValueError or TypeError in 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 cache or -g comps.xml to 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 TypeError in case the options are not a str.

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 ValueError in 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 TypeError if 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 TypeError in case we run into

property mirror_locally: bool

If this property is set to True then 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 TypeError in case after the conversion of the value is not of type bool.

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 TypeError or ValueError in 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 TypeError or ValueError.

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 TypeError in 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.

property rsyncopts: Dict[Any, Any]

Options for rsync when being used for repo management.

Getter:

The options to apply to the generated ones.

Setter:

A str or dict to replace the old options with. If the str can’t be parsed we throw a ValueError.

property yumopts: Dict[Any, Any]

Options for the yum tool. Should be presented in the same way as the kernel_options.

Getter:

The dict with the parsed options.

Setter:

Either the dict or a str which is then parsed. If parsing is unsuccessful then a ValueError is raised.

7.1.6.11. cobbler.items.system module

All code belonging to Cobbler systems.

Changelog (System):

V3.4.0 (unreleased):
  • Added:
    • display_name: str

    • redhat_management_org: enums.VALUE_INHERITED

    • redhat_management_user: enums.VALUE_INHERITED

    • redhat_management_password: enums.VALUE_INHERITED

  • Changes:
    • Constructor: kwargs can 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 default is 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_v4

    • next_server_v6

  • Changed:
    • virt_*: Cannot be set to inherit anymore

    • enable_gpxe: Renamed to enable_ipxe

  • Removed:
    • get_fields()

    • next_server - Please use one of next_server_v4 or next_server_v6

    • set_boot_loader() - Moved to boot_loader property

    • set_server() - Moved to server property

    • set_next_server() - Moved to next_server property

    • set_filename() - Moved to filename property

    • set_proxy() - Moved to proxy property

    • set_redhat_management_key() - Moved to redhat_management_key property

    • get_redhat_management_key() - Moved to redhat_management_key property

    • set_dhcp_tag() - Moved to NetworkInterface class property dhcp_tag

    • set_cnames() - Moved to NetworkInterface class property cnames

    • set_status() - Moved to status property

    • set_static() - Moved to NetworkInterface class property static

    • set_management() - Moved to NetworkInterface class property management

    • set_dns_name() - Moved to NetworkInterface class property dns_name

    • set_hostname() - Moved to hostname property

    • set_ip_address() - Moved to NetworkInterface class property ip_address

    • set_mac_address() - Moved to NetworkInterface class property mac_address

    • set_gateway() - Moved to gateway property

    • set_name_servers() - Moved to name_servers property

    • set_name_servers_search() - Moved to name_servers_search property

    • set_netmask() - Moved to NetworkInterface class property netmask

    • set_if_gateway() - Moved to NetworkInterface class property if_gateway

    • set_virt_bridge() - Moved to NetworkInterface class property virt_bridge

    • set_interface_type() - Moved to NetworkInterface class property interface_type

    • set_interface_master() - Moved to NetworkInterface class property interface_master

    • set_bonding_opts() - Moved to NetworkInterface class property bonding_opts

    • set_bridge_opts() - Moved to NetworkInterface class property bridge_opts

    • set_ipv6_autoconfiguration() - Moved to ipv6_autoconfiguration property

    • set_ipv6_default_device() - Moved to ipv6_default_device property

    • set_ipv6_address() - Moved to NetworkInterface class property ipv6_address

    • set_ipv6_prefix() - Moved to NetworkInterface class property ipv6_prefix

    • set_ipv6_secondaries() - Moved to NetworkInterface class property ipv6_secondaries

    • set_ipv6_default_gateway() - Moved to NetworkInterface class property ipv6_default_gateway

    • set_ipv6_static_routes() - Moved to NetworkInterface class property ipv6_static_routes

    • set_ipv6_mtu() - Moved to NetworkInterface class property ipv6_mtu

    • set_mtu() - Moved to NetworkInterface class property mtu

    • set_connected_mode() - Moved to NetworkInterface class property connected_mode

    • set_enable_gpxe() - Moved to enable_gpxe property

    • set_profile() - Moved to profile property

    • set_image() - Moved to image property

    • set_virt_cpus() - Moved to virt_cpus property

    • set_virt_file_size() - Moved to virt_file_size property

    • set_virt_disk_driver() - Moved to virt_disk_driver property

    • set_virt_auto_boot() - Moved to virt_auto_boot property

    • set_virt_pxe_boot() - Moved to virt_pxe_boot property

    • set_virt_ram() - Moved to virt_ram property

    • set_virt_type() - Moved to virt_type property

    • set_virt_path() - Moved to virt_path property

    • set_netboot_enabled() - Moved to netboot_enabled property

    • set_autoinstall() - Moved to autoinstall property

    • set_power_type() - Moved to power_type property

    • set_power_identity_file() - Moved to power_identity_file property

    • set_power_options() - Moved to power_options property

    • set_power_user() - Moved to power_user property

    • set_power_pass() - Moved to power_pass property

    • set_power_address() - Moved to power_address property

    • set_power_id() - Moved to power_id property

    • set_repos_enabled() - Moved to repos_enabled property

    • set_serial_device() - Moved to serial_device property

    • set_serial_baud_rate() - Moved to serial_baud_rate property

V3.2.2:
  • No changes

V3.2.1:
  • Added:
    • kickstart: Resolves as a proxy to autoinstall

V3.2.0:
  • No changes

V3.1.2:
  • Added:
    • filename: str - Inheritable

    • set_filename()

V3.1.1:
  • No changes

V3.1.0:
  • No changes

V3.0.1:
  • File was moved from cobbler/item_system.py to cobbler/items/system.py.

V3.0.0:
  • Field definitions for network interfaces moved to own FIELDS array

  • Added:
    • boot_loader: str - Inheritable

    • next_server: str - Inheritable

    • power_options: str

    • power_identity_file: str

    • serial_device: int

    • serial_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 to autoinstall

    • ks_meta: Renamed to autoinstall_meta

    • from_datastruct: Renamed to from_dict()

    • set_kickstart(): Renamed to set_autoinstall()

  • Removed:
    • redhat_management_server

    • set_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: str

    • uid: str

    • owners: List[str] - Inheritable

    • profile: str - Name of the profile

    • image: str - Name of the image

    • status: 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 - Inheritable

    • proxy: str - Inheritable

    • netboot_enabled: bool

    • kickstart: str - Inheritable

    • comment: str

    • depth: int

    • server: str - Inheritable

    • virt_path: str - Inheritable

    • virt_type: str - Inheritable; One of “xenpv”, “xenfv”, “qemu”, “kvm”, “vmware”, “openvz”

    • virt_cpus: int - Inheritable

    • virt_file_size: float - Inheritable

    • virt_disk_driver: str - Inheritable; One of “<<inherit>>”, “raw”, “qcow”, “qcow2”, “aio”, “vmdk”, “qed”

    • virt_ram: int - Inheritable

    • virt_auto_boot: bool - Inheritable

    • virt_pxe_boot: bool

    • ctime: float

    • mtime: float

    • power_type: str - Default loaded from settings key power_management_default_type

    • power_address: str

    • power_user: str

    • power_pass: str

    • power_id: str

    • hostname: str

    • gateway: str

    • name_servers: List[str]

    • name_servers_search: List[str]

    • ipv6_default_device: str

    • ipv6_autoconfiguration: bool

    • mgmt_classes: List[Any] - Inheritable

    • mgmt_parameters: str - Inheritable

    • boot_files: Dict[str, Any]/List (Not reverse engineeriable) - Inheritable

    • fetchable_files: Dict[str, Any] - Inheritable

    • template_files: Dict[str, Any] - Inheritable

    • redhat_management_key: str - Inheritable

    • redhat_management_server: str - Inheritable

    • template_remote_kickstarts: bool - Default loaded from settings key template_remote_kickstarts

    • repos_enabled: bool

    • ldap_enabled: - bool

    • ldap_type: str - Default loaded from settings key ldap_management_default_type

    • monit_enabled: bool

class cobbler.items.system.System(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: BootableItem

A 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 dns: DNSOption

Property for the DNSOptions.

Getter:

The DNSOptions of the System.

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 get_mac_addresses: Set[str]

Get the set of system mac addresses.

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 default one.

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.

make_clone()[source]

Must be defined in any subclass

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.

class cobbler.items.system_group.SystemGroup(api: CobblerAPI, *args: Any, **kwargs: Any)[source]

Bases: ItemGroup

SystemGroup class

COLLECTION_TYPE = 'system_group'
TYPE_NAME = 'system_group'
make_clone() BaseItem[source]

Clone this system group

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: BaseItem

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

check_if_valid()[source]

Check if a distro object is valid. If invalid an exception is raised.

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.

make_clone() Template[source]

Must be defined in any subclass

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.

property template_type: str

This represents the template type/language that must be used to render the template.

Getter:

Returns the current template_type.

Setter:

Sets the new value for the template_type property.

property uri: URIOption

Represents the location where the template is located at.

Getter:

Returns the current URIOption object.

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