Skip to content
Snippets Groups Projects
Name Last commit Last update
defaults
handlers
meta
tasks
tests
vars
README.md

Description

This role provides base methods for each system role.

Requirement

function defined variables

  • function_packages (for container creation)

User defined variables

  • users
  • usergroups
  • network.hostname
  • timezone

Roles

  • package.auth.sudo

Variables

  • system_home_mirror:

    • description:
      • URL of the producer's package repository
    • hint: This variable is set by each system.
  • system_local_mirror:

    • description:
      • URL of the local package repository
  • system_mirror_directory:

    • description:
      • path to the root mirror directory on system for all system
    • hint: This variable is set by function role.
  • system_supported_architures:

    • description:
      • list of system architectures supported by the system role; needed for installer und mirror
    • hint: This variable is set by each system.
  • system_supported_releases:

    • description:
      • list of system releases supported by the system role; needed for installer und mirror
    • hint: This variable is set by each system.
  • system_container_base_config:

    • description:
      • path to the base configuration file for containers
    • hint: default file is provided by this system role
  • system_container_root:

    • description:
      • path to the root directory for each jail
    • hint: default file is provided by this system role
  • system_suppress_container_creation:

    • description:
      • If this option is set to true, the system will be prepared for container usage, but none will be installed.
    • choises: [true, false]
    • default: false
  • system_installer_path:

    • description:
      • This destination directory path for the installer on the installer server (see system_installer_server).
    • default: undefined
  • system_installer_images:

    • description:
      • This option is an array of tuples of installer images.
      • A tuple has the following structure: (image, kernel, distribution, release, architecture)
        • image: path to the installer image
        • kernel: path to the installer kernel. If the installer is within a memdisk image, this option should be an empty string, this option should be an empty string.
        • distribution: name of the installer distribution
        • release: name of the installer release
        • architecture: name of the installer architecture
      • It is generated automatically by the child SDM roles.
  • system_answerfile_basepath:

    • description:
      • This option contains the destination directory path for answer files on the answer file server (see system_answerfile_server).
    • default: undefined
  • system_answerfile_path:

    • description:
      • This option contains the destination path to the answer file on the answer file server (see system_answerfile_server).
      • It consists of the answer file base path (system_answerfile_basepath) and the hostname in upper letter.
      • It is generated automatically.
  • system_answerfile_server:

    • description:
      • This option specifies a the server or a server group that hosts the answer files.
    • default: localhost
  • system_answerfile_user:

    • description:
      • This options specifies the user with the permissions to set or reset an answer file.
    • default: root
  • system_answerfile_state:

    • description:
      • This option specifies the state on the answer file server.
    • choices: ["present", "absent"]
    • default: "present"
  • system_answerfile_url:

    • description:
      • This option contains the base URL to answer files.
      • It is used by the installer.
    • default: "tftp://localhost"
  • system_name:

    • description:
      • contains the distribution name of a system; needed for gatherpackages
  • system_gathered_packages:

    • description:
      • list of all packages; result of gatherpackages
  • system_upgrade_states:

    • description:
      • a dictionary with the results of upgrade (see features)
  • system_app_root:

    • description:
      • contains the general path for applications without final path separator
      • must be set in defaults/main.yml of each system role
    • examples:
      • Linux: system_app_root: "/usr"
      • FreeBSD: system_app_root: "/usr/local"
      • OpenBSD: system_app_root: "/usr/local"
      • NetBSD: system_app_root: "/usr/pkg"
    • default: undefined
  • system_config_directory:

    • description:
      • contains the general path for configuration files of applications without final path separator
      • must be set in defaults/main.yml of each system role
    • examples:
      • Linux: system_app_root: "/etc"
      • FreeBSD: system_app_root: "/usr/local/etc"
      • OpenBSD: system_app_root: "/etc"
      • NetBSD: system_app_root: "/usr/pkg/etc"
    • default: undefined
  • system_fallback_admin_method

    • description
      • This option specifies the fallback method for the administrative access to a system.
      • Two values are currently possible: root and sudo
      • The value root enables and sets the password of the root user.
      • The value sudo disables the password of the root user and installs the sudo utility. It requires the SDM package package.auth.sudo.
      • The password for both methods will be stored in the <sdm_passwords>-directory.
    • default: root
    • choices:
      • root
      • sudo
    • Hint: This option is currently under development. Please use it carefully.
  • system_fallback_sudo_username

    • description:
      • The option system_fallback_sudo_username specifies the username with administrative access permissions.
      • The username does not have to be defined in the global variable users.
      • It is only considered, if the value of system_fallback_admin_method is set to sudo.
      • The password for this user is stored in the <sdm_passwords>-directory.
    • default: ansible
    • Hint: This option is currently under development. Please use it carefully.
  • system_fallback_sudo_groupname

    • description:
      • This option specifies the groupname with administrative access permissions.
      • The groupname does not have to be defined in the global variable group.
      • It is only considered, if the value of system_fallback_admin_method is set to sudo.
    • default: sudo
    • Hint: This option is currently under development. Please use it carefully.
  • system_password_algorithm:

  • system_resolver

    • description:
      • This option specifies the resolver to be used.
    • default: resolved
  • system_network_manager

    • description:
      • This option specifies the network manager to be used.
    • default: networkd

Processes

main

  1. install and configure native packages

configure

  1. set hostname
  2. remove obsolete groups
  3. remove obsolete users
  4. add groups
  5. add users
  6. append groups to users, if defined
  7. enable or disable root user, depending on variable system_fallback_admin_method
  8. set timezone

shutdown

  1. shutdown host

reboot

  1. reboot host

Features

The task upgrade have to generate a dictionary with the states of upgrade process. The dictionary has following structure:

<inventory_hostname>: host: True|False <name of container 1>: True|False ... : True|False

The key host contains the upgrade state of the inventory host. The state True means that the host or container was upgraded. False that there are no upgrades for them.

License

BSD-3-Clauses

Contributors

martin.pietsch@tu-dresden.de