linux-system-roles.image_builder
Role Name
This role sets up and configures Image Builder to create Fedora and Red Hat Enterprise Linux operating system (OS) images. These are complete OS images, not container images, and can be used in cloud, virtual, and physical environments.
Requirements
- For RHEL/CentOS 7.x, the Extras repository needs to be enabled.
- If you are using this on a local node, you’ll need to enable the Ansible repository for RHEL/CentOS.
- It requires
linux-system-roles.cockpit
to set up the graphical user interface dependencies. - Optional recommendations:
- Use
linux-system-roles.storage
to prepare a dedicated file system for storing image files. - Use
linux-system-roles.firewall
to allow remote access to the Web Console.
- Use
Role Variables
By default, the main packages for the Image Builder command-line interface (CLI) and service will be installed:
vars:
ib_packages: [default, minimal, full]
ib_daemon: [lorax-composer, osbuild-composer]
- minimal (includes the CLI plus one backend engine)
lorax-composer
: backend build engine and API from the classic Anaconda installer.osbuild-composer
: next-gen backend engine and API.composer-cli
: command line interface.
- default (includes GUI from Cockpit)
cockpit-composer
: graphical front end for the Cockpit Web Console.
- full (currently the same as default, but may change)
cockpit-composer
: graphical front end for the Cockpit Web Console.
Example Playbooks
A very simple example:
---
- hosts: fedora, rhel7, rhel8
become: yes
roles:
- linux-system-roles.image_builder
A more advanced example that can set up optional storage and firewall:
- hosts: fedora, rhel7, rhel8
become: yes
# Assumes installation of RHEL System Roles
# yum install --enablerepo=rhel-7-server-ansible-2-rpms rhel-system-roles ansible
#
# Assumes installation of roles from Galaxy
# ansible-galaxy install linux-system-roles.storage
# ansible-galaxy install linux-system-roles.firewall
# ansible-galaxy install linux-system-roles.cockpit
vars:
USE_FIREWALL: 1
CONFIG_STORAGE: 0
tasks:
# Optional: set up a second disk to store OS image files.
# Minimal images are typically around 2 GB each.
# Alternatively, you can link to a NAS share.
- name: Configure storage for Image Builder
include_role:
name: linux-system-roles.storage
vars:
use_partitions: false
storage_pools:
- name: image_builder
disks: [''] # e.g., vdb
state: present
volumes:
- name: composer
size: "20G" # size depends on the number of images created
fs_label: "imgbldr"
mount_point: '/var/lib/lorax/composer'
when: CONFIG_STORAGE
# Optionally use the Cockpit role to install everything,
# otherwise, the Image Builder role installs the basic GUI dependencies.
- name: Install and enable RHEL/Fedora Web Console (Cockpit) service
include_role:
name: linux-system-roles.cockpit
vars:
cockpit_packages: "full" # or "minimal" or "default"
- name: Install and enable RHEL/Fedora Image Builder service
include_role:
name: linux-system-roles.image_builder
vars:
ib_packages: "full" # or "minimal" or "default"
- name: Configure Firewall for Web Console
include_role:
name: linux-system-roles.firewall
vars:
firewall:
service: cockpit
state: enabled
when: USE_FIREWALL
License
GPLv3
Informazioni sul progetto
Install and enable Image Builder for building OS images
Installa
ansible-galaxy install linux-system-roles.image_builder
Licenza
gpl-3.0
Download
3k
Proprietario