Skip to content

Conf Action

The conf action defines the contents of the <profile>.conf file. This file contains normal variables and environment variables.

Tip

Have a look at the source code of Simple-CDD on variables, to see which variables and environment variables are supported.

Usage

Click on the to learn more about the action's options.

Conf Action
{% set profile=profile or "base" -%}
{% set mirror_components=mirror_components or "main" -%}
{% set disk_type=disk_type or "DVD" -%}
{% set dist=dist or "bookworm" -%}

  - action: conf
    description: Simple-CDD configuration settings # (1)!
    variables: # (2)!
      profiles: {{profile}}
      auto_profiles: {{profile}}
      mirror_components: {{mirror_components}}
    env_variables: # (3)!
      DISKTYPE: {{disk_type}}
      CODENAME: {{dist}}
  1. [Optional] Description, for documentation purposes
  2. [Optional] Variable definitions
  3. [Optional] Environment variable definitions

Implementation

ConfAction

Bases: Action

Conf action

Source code in simple_cdd_yaml/actions.py
class ConfAction(Action):
    """ Conf action """
    def perform_action(self, props):
        description = props.get('description', 'Conf settings')
        conf_str = f'# {description}\n'
        if variables := props.get('variables'):
            for var, value in variables.items():
                conf_str += f'{var}="{value.rstrip()}"\n'
        if env_variables := props.get('env_variables'):
            for var, value in env_variables.items():
                conf_str += f'export {var}="{value.rstrip()}"\n'
        if variables or env_variables:
            return conf_str
        return None

    def perform_debos_action(self, props):
        return None