redhat-cop / infra.osbuild

Ansible Collection for management of ostree composer
GNU General Public License v3.0
33 stars 37 forks source link
validated-content

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:

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

Included Content

Roles:

Modules:

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