Ansible role for building RHEL images with Image Builder.
This role builds custom RHEL images with RHEL Image Builder. The role uses a given image blueprint from a Git repository and stores results on the build host.
To install this collection from GitHub:
ansible-galaxy collection install git+https://github.com/myllynen/rhel-image,master
Next, in a blueprint repository customize an image blueprint:
vi base-image.toml
git commit -m "Update base-image" base-image.toml
git push
Then, create a playbook to use this role:
---
- name: Build RHEL image with Image Builder
hosts: all
become: true
vars:
rhel_image_create_user: false
rhel_image_git_remote_repo: file:///tmp/rhel-image-blueprints.git
rhel_image_git_repo_checkout: master
rhel_image_blueprint: base-image
rhel_image_size_kb: 20480
rhel_image_output_type: qcow2
rhel_image_download_dir: /tmp/images
roles:
- myllynen.rhel_image.rhel_image
See roles/rhel_image/defaults/main.yml for all the supported parameters.
Finally, build the image on a build host:
ansible-playbook -i 192.168.122.123, image_builder.yml
See also https://github.com/myllynen/ansible-packer.
See also https://github.com/myllynen/rhel-ansible-roles.
GPLv3+