Alternative Image creation based on Any-Image

Four Approaches for creating images are supported:

  • default: using the compute-default or k3s-default playbooks which will create a base depending on the controller's distribution.
  • Base: using a ClusterVision provided base distribution.
  • Docker: using a docker based image creation approach.

The below sections cover examples for Base and Docker approaches.

Visit the Any-Image documentation for support matrix and more in-depth information regarding Any-Image.

Prerequisites

We work from the TrinityX local/cloned repo, Specifically the site directory where the other playbooks are presented. Refer to the installation documentation on how to clone TrinityX.

Base image approach for Rocky-8

Copy a compute playbook to a new one. For RedHat family distributions, compute-default.yml can be used. For other distributions, have a look at e.g. compute-ubuntu.yml or compute-opensuse.yml.

# cp compute-default.yml compute-myimage-rocky8.yml
# vi compute-myimage-rocky8.yml

Inside the compute-myimage-rocky8.yml yaml file:

  • change the image_name variable in the pre_tasks section only, to reflect your preferred image name.
  • uncomment the alternative_distribution variable and specify to your needs.
  • uncomment the alternative_image_source variable and specify 'base'

Please note the yaml format is highly sensitive to wrongfully placed spaces and tabs. It's important to 'line up' to prevent variables being ignored.

Then the playbook can be run:

# ansible-playbook compute-myimage-rocky8.yml

After the playbook finishes, the image appears in luna with the name set according to the 'image_name' variable

Docker image approach for Rocky-8

Copy a compute playbook to a new one. For RedHat family distributions, compute-default.yml can be used. For other distributions, have a look at e.g. compute-ubuntu.yml or compute-opensuse.yml.

# cp compute-default.yml compute-mydocker-rocky8.yml
# vi compute-mydocker-rocky8.yml

Inside the compute-mydocker-rocky8.yml yaml file:

  • change the image_name variable in the pre_tasks section only, to reflect your preferred image name.
  • uncomment the alternative_distribution variable and specify to your needs.
  • uncomment the alternative_image_source variable and specify 'docker'
  • uncomment or add the alternative_image_distr variable and specify either 'rocky', 'almalinux', 'opensuse', 'centos' or 'ubuntu'. For RedHat family distributions, alternative_image_distr is an optional variable. If not set, the distribution will be automatically detected.

The variable alternative_image_distr is needed to ensure correct ansible var/yml includes for distribution depended configuration. When undefined, ansible will fallback to the distribution information of the head node.

Please note the yaml format is highly sensitive to wrongfully placed spaces and tabs. It's important to 'line up' to prevent variables being ignored.

Then the playbook can be run:

# ansible-playbook compute-mydocker-rocky8.yml

After the playbook finishes, the image appears in luna with the name set according to the 'image_name' variable