7.1.1.1.1. cobbler.actions.buildiso package
7.1.1.1.1.1. Submodules
7.1.1.1.1.2. cobbler.actions.buildiso.append_line module
Module to centralize the generation of kernel options for custom built ISOs.
- class cobbler.actions.buildiso.append_line.AppendLineBuilder(api: CobblerAPI, distro_name: str, data: Dict[str, Any])[source]
Bases:
objectThis class is meant to be initiated for a single append line. Afterwards the object should be disposed.
- add_remaining_kopts(kopts: Dict[str, str | List[str]]) None[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.
- 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_standalone(data: Dict[Any, Any], distro: Distro, descendant: Profile | System) str[source]
Generates the append line for the kernel so the installation can be done unattended. :param data: The values for the append line. The key “kernel_options” must be present. :param distro: The distro object to generate the append line from. :param descendant: The profile or system which is underneath the distro. :return: The base append_line which we need for booting the built ISO. Contains initrd and autoinstall parameter.
- 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
7.1.1.1.1.3. cobbler.actions.buildiso.netboot module
This module contains the specific code to generate a network bootable ISO.
- class cobbler.actions.buildiso.netboot.NetbootBuildiso(api: CobblerAPI)[source]
Bases:
BuildIsoThis class contains all functionality related to building network installation images.
- 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: List[str] | None = None, xorrisofs_opts: str = '', distro_name: str | None = None, systems: List[str] | None = None, exclude_dns: bool = False, esp: str | None = None, exclude_systems: bool = False, **kwargs: Any)[source]
Generate a net-installer for a distribution.
By default, the ISO includes all available systems and profiles. Specify
profilesandsystemsto 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_opts –
xorrisofsoptions to include additionally.distro_name – For detecting the architecture of the ISO. If not provided, taken from first profile or system item
systems – 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.
exclude_systems – Whether system entries should not be exported.
7.1.1.1.1.4. 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:
BuildIsoThis class contains all functionality related to building self-contained installation images.
- run(iso: str = 'autoinst.iso', buildisodir: str = '', profiles: List[str] | None = None, systems: List[str] | None = None, xorrisofs_opts: str = '', distro_name: str | None = None, airgapped: bool = False, source: str = '', esp: str | None = None, exclude_systems: bool = False, **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
profilesandsystemparameters can be combined.- 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. None means all.
systems – The filter to generate the ISO only for selected systems. None means all.
xorrisofs_opts –
xorrisofsoptions to include additionally.distro_name – For detecting the architecture of the ISO. If not provided, taken from first profile or system item.
airgapped – This option implies
standalone=True.source – If the iso should be offline available this is the path to the sources of the image.
exclude_systems – Whether system entries should not be exported.
7.1.1.1.1.5. 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
- class cobbler.actions.buildiso.BootFilesCopyset(src_kernel, src_initrd, new_filename)[source]
Bases:
NamedTuple
- class cobbler.actions.buildiso.BuildIso(api: CobblerAPI)[source]
Bases:
objectHandles 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: List[str] | None = None) List[Profile][source]
Return a list of valid profile objects selected from all profiles by name, or everything if
selected_itemsis 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.
- filter_systems(selected_items: List[str] | None = None) List[System][source]
Return a list of valid system objects selected from all systems by name, or everything if
selected_itemsis 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.
- 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: List[str] | None, distro_obj: Distro) List[Profile][source]
Parses and filters profile names for a given distro, ensuring all profiles are valid children of the distro.
- Parameters:
profiles – The optional list of profile names. If no list is given, all profiles are used.
distro_obj – The distro object that acts as the parent.
- prepare_sources(distro_name: str | None, profiles: List[str] | None, systems: List[str] | None, exclude_systems: bool) Tuple[Distro, List[Profile], List[System]][source]
Preprocess input data to suitable format.
If distro is not provided, it is taken from first profile or system item. Profiles and systems are returned either as empty list or list of Profile, resp. System
- Parameters:
distro_name – Name of the distribution to use or None
profiles – List of profile names or None to include all
systems – List of system names or None to include all
exclude_systems – If set, do not include any system
- Raises:
ValueError – In case of unsupported distro architecture
- Returns:
Tuple with Distro, List of profiles and List of systems
- class cobbler.actions.buildiso.BuildisoDirsPPC64LE(root, grub, ppc, autoinstall, repo)[source]
Bases:
NamedTuple
- class cobbler.actions.buildiso.BuildisoDirsX86_64(root, isolinux, grub, autoinstall, repo)[source]
Bases:
NamedTuple