Chapter 8. Using RHEL system roles to build and manage immutable systems (ostree)
Use Red Hat Enterprise Linux (RHEL) system roles to automate and manage RHEL for Edge (rpm-ostree) immutable systems. This integration provides a consistent management interface across different backend technologies, allowing you to use the same roles for both traditional and immutable environments.
For example, you can use the Podman system role to automate configuration and deploy production-ready container workloads. By using unified roles, you ensure environment consistency while reducing the complexity of managing ostree-based systems.
This feature is incompatible with the nbde_client role.
8.1. RHEL system roles support for rpm-ostree systems Copy linkLink copied to clipboard!
Red Hat Enterprise Linux (RHEL) system roles support rpm-ostree systems by using a integrated functionality.
Because the /usr file system is read-only, roles verify pre-installed packages instead of installing them. A specialized interface ensures compatibility with rpm-ostree for seamless configuration management.
There are two separate phases for using RHEL system roles to manage RHEL image mode systems.
- Image build phase: Use RHEL image builder to build packages into an immutable image. During this phase, the packages are built into the image.
-
Runtime phase: Using RHEL system roles to manage the configuration and services on the running image. You can apply tasks and processes that you use to provision your systems at run time, such as Ansible roles, at the build time of the image. Image mode for RHEL uses the
ostreefile system on image-based systems with support for system roles.
8.2. Installing system role dependencies in a container build Copy linkLink copied to clipboard!
Each role provides a get_ostree_data.sh script to identify required packages and dependencies. This script facilitates integration into Red Hat Enterprise Linux (RHEL) image builder or other image builders.
Prerequisites
- You have prepared the control node and the managed nodes.
- You are logged in to the control node as a user who can run playbooks on the managed nodes.
-
The account you use to connect to the managed nodes has
sudopermissions for these nodes.
To install system role dependencies in a container build, complete the following steps.
Procedure
The
get_ostree_data.shscript is located in the.ostree/sub-directory of each role. List the dependencies for a role:$ /usr/share/ansible/collections/ansible_collections/redhat/rhel_system_roles/roles/<role_name>/.ostree/get_ostree_data.sh packages runtime <distro_version> <format>Get the list of packages needed for the SELinux system role, in the
tomlformat that RHEL image builder accepts:$ /usr/share/ansible/collections/ansible_collections/redhat/rhel_system_roles/roles/selinux/.ostree/get_ostree_data.sh packages runtime RedHat-<version> toml- Add the list of packages to your image builder manifest or instructions. This differs depending on the image builder you are using.