Hello,
There were couple questions about how a creation of template boxes
which are used in tests works, respectively how the boxes can be
amended. So I'll try to cover it in this mail so that it is reusable
in the future.
FreeIPA PR-CI is using vagrant to provision vms. So the base image is
Vagrant libvirt box. Boxes for Fedora are based on
Fedora-Cloud-Base-Vagrant-$VERSION-*x86_64.vagrant-libvirt.box boxes
which are being produced by Fedora project. The box name is defined in
ansible/vars/fedora dir for each version of Fedora, see:
https://github.com/freeipa/freeipa-pr-ci/tree/master/ansible/vars/fedora
FreeIPA base images are generated by utility 'create-template-box' (
https://github.com/freeipa/freeipa-pr-ci/blob/master/create-template-box
) which basically runs ansible/create_template_box.yml playbook (
https://github.com/freeipa/freeipa-pr-ci/blob/master/ansible/create_templ...
) This playbook has 4 steps:
1. Creating of template box from a base image - defined by box/prepare
ansible role
2. Doing some workarounds
3. Modifying the template box (use case of this mail). This is defined
by Ansible roles: "builder" and "machine". Let's skip builder and
focus on a test machine see ansible/roles/mahine/tasks/main.yml
4. Uploading of the template box to VagrantCloud - defined by
box/package ansible role
With machine role, be careful that it also contains roles:
machine/provision and machine/provision_ipaserver. These two are
executed in each test job execution (defined in Vagrantfile matching a
topology). So for box preparation see roles defined in the
machine/tasks/main.yml:
1. machine/setup
2. machine/workarounds
3. machine/cleanup
If our use case is adding an rpm dependency to a box itself, e.g.
firewalld, then the file to modify is:
machine/setup/tasks/install_packages.yml
https://github.com/freeipa/freeipa-pr-ci/blob/master/ansible/roles/machin...
If our use case is to install a dependency in each tests (usually not
preferred) then the file to modify is:
machine/provision/tasks/main.yml
https://github.com/freeipa/freeipa-pr-ci/blob/master/ansible/roles/machin...
So from a practical perspective, the workflow should be:
1. anybody can do the required changes in
"ansible/roles/machine/setup/tasks/$SOMETHING.yml" ansible files. Then
open a pull request on freeipa/freeipa-pr-ci GitHub project
https://github.com/freeipa/freeipa-pr-ci/pulls
2. FreeIPA-PR-CI team (currently mostly f-trivino, dhnunes and
netoarmando) will review the PR and merge if it is OK
3. anybody authorized (dedicated by team and has credentials, mostly
the same group as in #2) to upload new images to Vagrant cloud will
run create-template-box with the expected parameters
4. the image must be tested (at least couple runs of gating and some
nightly) if it is OK
5. to use in gating and nighlies, new version of the box (provided
that previous existed) needs to be specified in prci.yaml files
(nighly_master.yaml, gating.yaml) by changing the name of the template
(usually in build job, rest refers to it).
HTH
--
Petr Vobornik