8.1.1.1.1. cobbler.actions.buildiso package

8.1.1.1.1.1. Submodules

8.1.1.1.1.2. cobbler.actions.buildiso.netboot module

This module contains the specific code to generate a network bootable ISO.

class cobbler.actions.buildiso.netboot.AppendLineBuilder(distro_name: str, data: Dict[str, Any])[source]

Bases: object

This class is meant to be initiated for a single append line. Afterwards the object should be disposed.

generate_profile(distro_breed: str, os_version: str, protocol: str = 'http') str[source]

Generate the append line for the kernel for a network installation. :param distro_breed: The name of the distribution breed. :param os_version: The OS version of the distribution. :param protocol: The scheme that is used to read the autoyast file from the server :return: The generated append line.

generate_system(dist: Distro, system: System, exclude_dns: bool, scheme: str = 'http') str[source]

Generate the append-line for a net-booting system.

Parameters
  • dist – The distribution associated with the system.

  • system – The system itself

  • exclude_dns – Whether to include the DNS config or not.

  • scheme – The scheme that is used to read the autoyast file from the server

class cobbler.actions.buildiso.netboot.NetbootBuildiso(api: CobblerAPI)[source]

Bases: BuildIso

This class contains all functionality related to building network installation images.

filter_systems(selected_items: Optional[List[str]] = None) List[Any][source]

Return a list of valid system objects selected from all systems by name, or everything if selected_items is empty.

Parameters

selected_items – A list of names to include in the returned list.

Returns

A list of valid systems. If an error occurred this is logged and an empty list is returned.

make_shorter(distname: str) str[source]

Return a short distro identifier which is basically an internal counter which is mapped via the real distro name.

Parameters

distname – The distro name to return an identifier for.

Returns

A short distro identifier

run(iso: str = 'autoinst.iso', buildisodir: str = '', profiles: Optional[List[str]] = None, xorrisofs_opts: str = '', distro_name: str = '', systems: Optional[List[str]] = None, exclude_dns: bool = False, **kwargs: Any)[source]

Generate a net-installer for a distribution.

By default, the ISO includes all available systems and profiles. Specify profiles and systems to only include the selected systems and profiles. Both parameters can be provided at the same time.

Parameters
  • iso – The name of the iso. Defaults to “autoinst.iso”.

  • buildisodir – This overwrites the directory from the settings in which the iso is built in.

  • profiles – The filter to generate the ISO only for selected profiles.

  • xorrisofs_optsxorrisofs options to include additionally.

  • distro_name – For detecting the architecture of the ISO.

  • systems – Don’t use that when building standalone ISOs. The filter to generate the ISO only for selected systems.

  • exclude_dns – Whether the repositories have to be locally available or the internet is reachable.

8.1.1.1.1.3. cobbler.actions.buildiso.standalone module

This module contains the specific code for generating standalone or airgapped ISOs.

class cobbler.actions.buildiso.standalone.StandaloneBuildiso(api: CobblerAPI)[source]

Bases: BuildIso

This class contains all functionality related to building self-contained installation images.

run(iso: str = 'autoinst.iso', buildisodir: str = '', profiles: Optional[List[str]] = None, xorrisofs_opts: str = '', distro_name: str = '', airgapped: bool = False, source: str = '', **kwargs: Any)[source]

Run the whole iso generation from bottom to top. Per default this builds an ISO for all available systems and profiles. This is the only method which should be called from non-class members. The profiles and system parameters can be combined. :param iso: The name of the iso. Defaults to “autoinst.iso”. :param buildisodir: This overwrites the directory from the settings in which the iso is built in. :param profiles: The filter to generate the ISO only for selected profiles. :param xorrisofs_opts: xorrisofs options to include additionally. :param distro_name: For detecting the architecture of the ISO. :param airgapped: This option implies standalone=True. :param source: If the iso should be offline available this is the path to the sources of the image.

validate_repos(profile_name: str, repo_names: List[str], repo_mirrordir: Path)[source]

Sanity checks for repos to sync.

This function checks that repos are known to cobbler and have a local mirror directory. Raises ValueError if any repo fails the validation.

8.1.1.1.1.4. Module contents

Builds bootable CD images that have PXE-equivalent behavior for all Cobbler distros/profiles/systems currently in memory.

class cobbler.actions.buildiso.Autoinstall(config, repos)[source]

Bases: NamedTuple

config: str

Alias for field number 0

repos: List[str]

Alias for field number 1

class cobbler.actions.buildiso.BootFilesCopyset(src_kernel, src_initrd, new_filename)[source]

Bases: NamedTuple

new_filename: str

Alias for field number 2

src_initrd: str

Alias for field number 1

src_kernel: str

Alias for field number 0

class cobbler.actions.buildiso.BuildIso(api: CobblerAPI)[source]

Bases: object

Handles conversion of internal state to the isolinux tree layout

calculate_grub_name(desired_arch: Archs) str[source]

This function checks the bootloaders_formats in our settings and then checks if there is a match between the architectures and the distribution architecture. :param distro: The distribution to get the GRUB2 loader name for.

create_buildiso_dirs_ppc64le(buildiso_root: str) BuildisoDirsPPC64LE[source]

Create directories in the buildiso root.

Layout: . ├── autoinstall ├── boot ├── ppc └── repo_mirror

create_buildiso_dirs_x86_64(buildiso_root: str) BuildisoDirsX86_64[source]

Create directories in the buildiso root.

Layout: . ├── autoinstall ├── EFI │ └── BOOT ├── isolinux └── repo_mirror

filter_items(all_objs: Collection[ITEM], selected_items: List[str]) List[ITEM][source]

Return a list of valid profile or system objects selected from all profiles or systems by name, or everything if selected_items is empty.

Parameters
  • all_objs – The collection of items to filter.

  • selected_items – The list of names

Raises

ValueError – Second option that this error is raised when the list of filtered systems or profiles is empty.

Returns

A list of valid profiles OR systems. If an error occurred this is logged and an empty list is returned.

filter_profiles(selected_items: Optional[List[str]] = None) List[Profile][source]

Return a list of valid profile objects selected from all profiles by name, or everything if selected_items is empty. :param selected_items: A list of names to include in the returned list. :return: A list of valid profiles. If an error occurred this is logged and an empty list is returned.

parse_distro(distro_name: str) Distro[source]

Find and return distro object.

Parameters

distro_name – Name of the distribution to parse.

Raises

ValueError – If the distro is not found.

parse_profiles(profiles: Optional[List[str]], distro_obj: Distro) List[Profile][source]

TODO

Parameters
  • profiles – TODO

  • distro_obj – TODO

class cobbler.actions.buildiso.BuildisoDirsPPC64LE(root, grub, ppc, autoinstall, repo)[source]

Bases: NamedTuple

autoinstall: Path

Alias for field number 3

grub: Path

Alias for field number 1

ppc: Path

Alias for field number 2

repo: Path

Alias for field number 4

root: Path

Alias for field number 0

class cobbler.actions.buildiso.BuildisoDirsX86_64(root, isolinux, grub, autoinstall, repo)[source]

Bases: NamedTuple

autoinstall: Path

Alias for field number 3

grub: Path

Alias for field number 2

isolinux: Path

Alias for field number 1

repo: Path

Alias for field number 4

root: Path

Alias for field number 0

class cobbler.actions.buildiso.LoaderCfgsParts(isolinux, grub, bootfiles_copysets)[source]

Bases: NamedTuple

bootfiles_copysets: List[BootFilesCopyset]

Alias for field number 2

grub: List[str]

Alias for field number 1

isolinux: List[str]

Alias for field number 0

cobbler.actions.buildiso.add_remaining_kopts(kopts: Dict[str, Union[str, List[str]]]) str[source]

Add remaining kernel_options to append_line :param kopts: The kernel options which are not present in append_line. :return: A single line with all kernel options from the dictionary in the string. Starts with a space.