Anaconda configuration files

The installer loads its default configuration from the Anaconda configuration files. The configuration can be modified by kernel arguments and cmdline options and the result is written into a runtime configuration file. The configuration is not supposed to change after that. The runtime configuration file is loaded by the Anaconda DBus modules when they are started. It means that all Anaconda processes are running with the same configuration.

Note

The interactive-defaults.ks file will be replaced by the Anaconda configuration files in the future. Kickstart files should be used only for the automatic installation.

File structure

The Anaconda configuration files are written in the INI format that can be processed by configparser. The files consist of sections, options and comments. Each section is defined by a [section] header. Each option is defined by a key and optionally a value separated by the = sign. Each comment has to start on a new line prefixed by the # character.

See an example of a section:

[Storage Constraints]

# Minimal size of the total memory.
min_ram = 320 MiB

# Should we recommend to specify a swap partition?
swap_is_recommended = False

# Recommended minimal sizes of partitions.
# Specify a mount point and a size on each line.
min_partition_sizes =
    /      250 MiB
    /usr   250 MiB

# Required minimal sizes of partitions.
# Specify a mount point and a size on each line.
req_partition_sizes =

The supported sections and options are documented in the default configuration file.

Default configuration file

The default configuration file provides a full default configuration of the installer. It defines and documents all supported sections and options. The file is located at /etc/anaconda/anaconda.conf:

# Anaconda configuration file.
# Version: unstable


[Anaconda]
# Run Anaconda in the debugging mode.
debug = False

# Enable Anaconda addons.
addons_enabled = True

# List of enabled Anaconda DBus modules.
kickstart_modules =
    org.fedoraproject.Anaconda.Modules.Timezone
    org.fedoraproject.Anaconda.Modules.Network
    org.fedoraproject.Anaconda.Modules.Localization
    org.fedoraproject.Anaconda.Modules.Security
    org.fedoraproject.Anaconda.Modules.Users
    org.fedoraproject.Anaconda.Modules.Payloads
    org.fedoraproject.Anaconda.Modules.Storage
    org.fedoraproject.Anaconda.Modules.Services


[Installation System]
# Type of the installation system.
# FIXME: This is a temporary solution.
type = UNKNOWN

# Should the installer show a warning about unsupported hardware?
can_detect_unsupported_hardware = False

# Should the installer show a warning about removed support for hardware?
can_detect_support_removed = False

# Should the installer show a warning about enabled SMT?
can_detect_enabled_smt = False


[Installation Target]
# Type of the installation target.
type = HARDWARE

# A path to the physical root of the target.
physical_root = /mnt/sysimage

# A path to the system root of the target.
system_root = /mnt/sysroot

# Should we install the network configuration?
can_configure_network = True


[Network]
# Network device to be activated on boot if none was configured so.
# Valid values:
#
#   NONE                   No device
#   DEFAULT_ROUTE_DEVICE   A default route device
#   FIRST_WIRED_WITH_LINK  The first wired device with link
#
default_on_boot = NONE


[Payload]
# Default package environment.
default_environment =

# List of ignored packages.
ignored_packages =

# Names of repositories that provide latest updates.
updates_repositories =

# List of .treeinfo variant types to enable.
# Valid items:
#
#   addon
#   optional
#   variant
#
enabled_repositories_from_treeinfo = addon optional variant

# Enable installation from the closest mirror.
enable_closest_mirror = True

# Enable possibility to skip packages with conflicts and broken dependencies.
enable_ignore_broken_packages = True

# Default installation source.
# Valid values:
#
#    CLOSEST_MIRROR  Use closest public repository mirror.
#    CDN             Use Content Delivery Network (CDN).
#
default_source = CLOSEST_MIRROR

# Enable ssl verification for all HTTP connection
verify_ssl = True

# GPG keys to import to RPM database by default.
# Specify paths on the installed system, each on a line.
# Substitutions for $releasever and $basearch happen automatically.
default_rpm_gpg_keys =

[Security]
# Enable SELinux usage in the installed system.
# Valid values:
#
#  -1  The value is not set.
#   0  SELinux is disabled.
#   1  SELinux is enabled.
#
selinux = -1


[Bootloader]
# Type of the bootloader.
# Supported values:
#
#   DEFAULT   Choose the type by platform.
#   EXTLINUX  Use extlinux as the bootloader.
#
type = DEFAULT

# Name of the EFI directory.
efi_dir = default

# Hide the GRUB menu.
menu_auto_hide = False

# Are non-iBFT iSCSI disks allowed?
nonibft_iscsi_boot = False

# Arguments preserved from the installation system.
preserved_arguments =
    cio_ignore rd.znet rd_ZNET zfcp.allow_lun_scan
    speakup_synth apic noapic apm ide noht acpi video
    pci nodmraid nompath nomodeset noiswmd fips selinux
    biosdevname ipv6.disable net.ifnames net.ifnames.prefix
    nosmt


[Storage]
# Enable dmraid usage during the installation.
dmraid = True

# Enable iBFT usage during the installation.
ibft = True

# Do you prefer creation of GPT disk labels?
gpt = False

# Tell multipathd to use user friendly names when naming devices during the installation.
multipath_friendly_names = True

# Do you want to allow imperfect devices (for example, degraded mdraid array devices)?
allow_imperfect_devices = False

# Btrfs compression algorithm and level. e.g. zstd:1
btrfs_compression =

# Default file system type. Use whatever Blivet uses by default.
file_system_type =

# Default partitioning.
# Specify a mount point and its attributes on each line.
#
# Valid attributes:
#
#   size <SIZE>    The size of the mount point.
#   min <MIN_SIZE> The size will grow from MIN_SIZE to MAX_SIZE.
#   max <MAX_SIZE> The max size is unlimited by default.
#   free <SIZE>    The required available space.
#
default_partitioning =
    /     (min 1 GiB, max 70 GiB)
    /home (min 500 MiB, free 50 GiB)

# Default partitioning scheme.
# Valid values:
#
#   PLAIN      Create standard partitions.
#   BTRFS      Use the Btrfs scheme.
#   LVM        Use the LVM scheme.
#   LVM_THINP  Use LVM Thin Provisioning.
#
default_scheme = LVM

# Default version of LUKS.
# Valid values:
#
#   luks1  Use version 1 by default.
#   luks2  Use version 2 by default.
#
luks_version = luks2


[Storage Constraints]

# Minimal size of the total memory.
min_ram = 320 MiB

# Minimal size of the available memory for LUKS2.
luks2_min_ram = 128 MiB

# Should we recommend to specify a swap partition?
swap_is_recommended = False

# Recommended minimal sizes of partitions.
# Specify a mount point and a size on each line.
min_partition_sizes =
    /      250 MiB
    /usr   250 MiB
    /tmp   50  MiB
    /var   384 MiB
    /home  100 MiB
    /boot  512 MiB

# Required minimal sizes of partitions.
# Specify a mount point and a size on each line.
req_partition_sizes =

# Allowed device types of the / partition if any.
# Valid values:
#
#   LVM        Allow LVM.
#   MD         Allow RAID.
#   PARTITION  Allow standard partitions.
#   BTRFS      Allow Btrfs.
#   DISK       Allow disks.
#   LVM_THINP  Allow LVM Thin Provisioning.
#
root_device_types =

# Mount points that must be on a linux file system.
# Specify a list of mount points.
must_be_on_linuxfs = / /var /tmp /usr /home /usr/share /usr/lib

# Paths that must be directories on the / file system.
# Specify a list of paths.
must_be_on_root = /bin /dev /sbin /etc /lib /root /mnt lost+found /proc

# Paths that must NOT be directories on the / file system.
# Specify a list of paths.
must_not_be_on_root =

# Mount points that are recommended to be reformatted.
#
# It will be recommended to create a new file system on a mount point
# that has an allowed prefix, but doesn't have a blocked one.
# Specify lists of mount points.
reformat_allowlist = /boot /var /tmp /usr
reformat_blocklist = /home /usr/local /opt /var/www


[User Interface]
# The path to a custom stylesheet.
custom_stylesheet =

# The path to a directory with help files.
help_directory = /usr/share/anaconda/help

# Default help pages for TUI, GUI and Live OS.
default_help_pages =

# Is the partitioning with blivet-gui supported?
blivet_gui_supported = True

# A list of spokes to hide in UI.
# FIXME: Use other identification then names of the spokes.
hidden_spokes =

# Run GUI installer in a decorated window.
decorated_window = False

# Should the UI allow to change the configured root account?
can_change_root = False

# Should the UI allow to change the configured user accounts?
can_change_users = False

# Define the default password policies.
# Specify a policy name and its attributes on each line.
#
# Valid attributes:
#
#   quality <NUMBER>  The minimum quality score (see libpwquality).
#   length <NUMBER>   The minimum length of the password.
#   empty             Allow an empty password.
#   strict            Require the minimum quality.
#
password_policies =
    root (quality 1, length 6)
    user (quality 1, length 6, empty)
    luks (quality 1, length 6)


[License]
# A path to EULA (if any)
#
# If the given distribution has an EULA & feels the need to
# tell the user about it fill in this variable by a path
# pointing to a file with the EULA on the installed system.
#
# This is currently used just to show the path to the file to
# the user at the end of the installation.
eula =

Product configuration files

The product configuration files allow to override some of the configuration options for specific products. The files are located at /etc/anaconda/product.d/.

Note

Anaconda previously used so called install classes for the product-specific configuration. Install classes were completely removed and replaced by the product configuration files.

Product identification

The product is defined by a product name and optionally a variant name. For example, Fedora Server has a product name Fedora and a variant name Server. See the terminology of productmd.

The product can be specified by the boot options inst.product and inst.variant. Otherwise, it will be automatically loaded from the .buildstamp file on the installation media. This file is generated by lorax using the --product and --variant options.

Based on the provided product and variant names, the installer will look up the right configuration file in the /etc/anaconda/product.d/ directory.

File structure

Product configuration files have one or two extra sections that identify the product. The [Product] section specifies the product and variant names of a product. The [Base Product] section specifies the product and variant names of a base product if any. For example, Fedora is a base product of Fedora Server.

Note

We are not going to support wildcards in product names. This used to be supported in install classes and it caused a lot of problems. The product name can match unrelated configurations and you cannot be sure which configuration is going to be used at the end.

We support a simple inheritance of product configurations. The installer loads configuration files of the base products before it loads the configuration file of the specified product. For example, it will first load the configuration for Fedora and then the configuration for Fedora Server.

Note

We are not going to support multiple inheritance. It would significantly increase the complexity of the product configuration files in an unintuitive way. You can easily compare two configuration files and verify the parts they are supposed to share. We do that in our unit tests.

See an example of the product configuration file for Fedora Server:

# Anaconda configuration file for Fedora Server.

[Product]
product_name = Fedora
variant_name = Server

[Base Product]
product_name = Fedora

[Payload]
default_environment = server-product-environment

[Storage]
file_system_type = xfs
default_scheme = LVM

Custom configuration files

The custom configuration files allow to override some of the configuration options for specific installations. The files are located at /etc/anaconda/conf.d/.

The installer finds all files with the .conf extension in the /etc/anaconda/conf.d/ directory, sorts them by their name and loads them in this order. These files are loaded after the product configuration files, so they have a higher priority.

For example, the initial setup installs the 10-initial-setup.conf file with a custom configuration.

Note

All configuration files have to be loaded before the installer starts to parse the kickstart file, so it is not possible to generate a configuration file in the %pre section of the kickstart file. Please, use updates.img or product.img instead.

Runtime configuration file

The runtime configuration file is a temporary file that provides a full configuration of the current installer run. It is generated by the installer and it exists only during its lifetime. The file is located at /run/anaconda/anaconda.conf.

The runtime configuration file is loaded by the Anaconda DBus modules when they are started. It allows us to run all Anaconda processes with the same configuration.

The installer makes the following steps to create the runtime configuration file. The configuration is not supposed to change after that.

  1. Load the default configuration file from /etc/anaconda/anaconda.conf.
  2. Load the selected product configuration files from /etc/anaconda/product.d/*.conf.
  3. Load the custom configuration files from /etc/anaconda/conf.d/*.conf.
  4. Apply the kernel arguments.
  5. Apply the cmdline options.
  6. Generate the runtime configuration file /run/anaconda/anaconda.conf.

Python representation

The Anaconda configuration is represented by the conf object from pyanaconda.core.configuration.anaconda. The configuration sections are represented by properties of the conf object. The configuration options are represented by properties of the section representation. All these properties are read-only.

The conf object is initialized on the first import. It loads the runtime configuration file, if it exists, otherwise it loads the default configuration file. Its main purpose is to provide access to the configuration of the current installer run.

It is safe to use the conf object in the Anaconda DBus modules and in any other Python processes that are started after a runtime configuration file has been generated.

See an example of a Python code:

from pyanaconda.core.configuration.anaconda import conf

# Is Anaconda in the debugging mode?
print(conf.anaconda.debug)

# Is the type of the installation target hardware?
print(conf.target.is_hardware)

# A path to the system root of the target.
print(conf.target.system_root)