Skip to content

redhat-cop/infra.osbuild

Osbuild Composer Ansible Collection

GitHub Super-LinterCodecovOpenSSF Best PracticesOpenSSF Scorecard

Ansible Collection for management of osbuild composer to build rpm-ostree based images for Fedora, Red Hat Enterprise Linux, and Centos Stream. This collection has roles to build an osbuild server, an apache httpd server to host images, and a role to build installer images and rpm-ostree updates.

Installing

To install this collection and its dependencies, you will need to use the Ansible ansible-galaxy command:

ansible-galaxy collection install infra.osbuild

How to use

You will need a RHEL, Centos Stream, or Fedora system that you can connect to remotely via ssh, and a playbook to call the desired roles to result in the desired functionality. Each role has it's own documentation specific to its provided automation.

To use the example playbooks provided in this repository, please create an inventory file that only has the osbuild build server(s) listed in them as these example playbooks use the all Ansible group as the host patten.

Configure Osbuild Builder

ansible-playbook playbooks/osbuild_setup_server.yml

Build an Image

ansible-playbook playbooks/osbuild_builder.yml

You can specify what kind of build you prefer with the variable buidler_compose_type.

Current supported and tested build types are:

  • edge-commit
  • edge-container
  • edge-installer
  • edge-simplified-installer
  • edge-raw-image
  • iot-commit (fedora only)
  • iot-container (fedora only)
  • iot-installer (fedora only)
  • iot-raw-image (fedora only)

Example:

ansible-playbook playbooks/osbuild_builder.yml -e builder_compose_type=edge-installer

Image Hosting

Images are hosted via apache http server that is setup using the setup_server playbook. The images are located at this path on the osbuild server: /var/www/html/<blueprint_name>/images. Inside the image directory will be version subdirectories for each iso built.

Kickstart Hosting

Image kickstart files are also hosted that can be used as a boot option via http on the osbuild server. The path is http://<ip_addr>/<blueprint_name>/kickstart.ks

Auditing versions

You can run rpm-ostree status to see what specific version the system is using.

Here is a sample output:

Deployments:
* edge:rhel/8/x86_64/edge
    Version: 0.0.1 (2023-04-07T19:40:08Z)
    Commit: 7d3461f2fce7572fcdc9b3e8f75677bcdf96afed1ff5a3953f81852aad51f78d

Supported Versions of Ansible

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.12.

Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. PEP440 is the schema used to describe the versions of Ansible.

Tested with Ansible

  • ansible-core 2.14 (devel)
  • ansible-core 2.13 (stable)
  • ansible-core 2.12 (stable)

Included Content

Roles:

  • builder
  • populate_aap
  • setup_server
  • system_info
  • update_system

Modules:

  • create_blueprint
  • export_compose
  • get_all_finished_images
  • inject_ks
  • list_blueprint
  • repository
  • rhsm_repo_info
  • start_compose
  • wait_compose

Code of Conduct

Please see the official Ansible Community Code of Conduct.

Licensing

GNU General Public License v3.0 or later

Contributing to this collection

We welcome community contributions to this collection. See Contributing to Ansible-maintained collections for complete details.

Testing policy

It's required for new or existing features to have tests for positive and negative scenarios. The tests are executed by ansible-test and those run in the CI.

Units

ansible-test units --docker --python $PYTHON_VERSION $TEST_FILE_PATH

Integration

ansible-test integration --remote rhel/$RHEL_VERSION $IMAGE_TYPE

Known issues

  • rpm-ostree may crash when trying to run the rpm-ostree upgrade --check command. This is caused by an open issue in rpm-ostee found here: coreos/rpm-ostree#4280