When we want to create a large set of containers at the same time, an
action plugin can now be used which will call the podman_container
module.
The podman_containers action plugin takes a list of containers with
pre-defined parameters ready to be consumed by the podman_container
module.
The podman_containers module is just useful for Ansible documentation.
The molecule tests will ensure that the action plugin actually works and
creates the 3 containers.
Change-Id: I1e6881f3871a7a125db9374c608ecad0bafcb882
If a service never starts, the "status" key won't exist so Ansible
raises with KeyError which is very misleading (we don't even have the
service name).
This make pass the KeyError exception, so we fail at the end of the loop
of attempts with proper Ansible raise and we give the service name.
Change-Id: I74f3d5b51bde1ec33b69b2488174eef9cc4a330d
If an operator would have disabled or stopped the service, we make sure
that it is again enabled and started when a deployment occurs.
We also add test coverage for it in molecule.
Change-Id: I97a6819574772835eb4a291b63bb05551fe4439a
1) shutdown: include tasks without a block. this should remove the stat
and include task; to only have one task that include the shutdown
playbook if needed.
2) Remove containers_changed tasks. This is not useful to restart a
container just because its podman_container resource changed.
when podman_container module applies a change to the container, this
one is already restarted.
3) Remove all_containers_commands tasks, there aren't needed. Ansible
output already provides the commands that are run via the
container_status module.
Change-Id: Ic625bc5dd7bbd964d36eab0a3f81eca31c533716
Support the checks of "podman exec" commands, and add the commands to
the list of things podman ran.
It reduces the number of tasks as it removes get_commands_exec and
re-use the container_status action plugin.
Change-Id: I4c84b389b595a8fe18ef6d31e896d6b6608b9920
Change the wording when a container will be added to the list of
containers that will be restarted, so it's not confusing.
Change-Id: Ieb50138b5c1d35fa3c59dd368a58c1af3f61807b
Instead of running a bunch of tasks to manage systemd resources, move
it into an action plugin which should make the execution faster and
easier to debug as well.
Example of task:
- name: Manage container systemd services
container_systemd:
container_config:
- keystone:
image: quay.io/tripleo/keystone
restart: always
- mysql:
image: quay.io/tripleo/mysql
stop_grace_period: 25
restart: always
The output is "restarted" for the list of services that were actually
restarted in systemd.
Note on testing: since that module is consummed by
tripleo_container_manage role, there is no need to create dedicated
molecule tests, we already cover containers with restart policy in that
role's molecule tests. So we'll re-use it.
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Co-Authored-By: Kevin Carter <kecarter@redhat.com>
Change-Id: I614766bd9b111bda9ddfea0a60b032e1dee09abc
Instead of running a bunch of tasks to figure out what container
commands have been run, which ones did not terminate after 5 minutes,
which ones failed or finished with a wrong exit code. We now have an
action plugin that will do it faster and with better logging.
Faster before it reduces the number of tasks.
Better logging is provided, now displaying all errors during a run and
fail at the end.
Supporting check-mode.
Re-using tripleo_container_manage role for molecule testing.
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Co-Authored-By: Kevin Carter <kecarter@redhat.com>
Change-Id: Ie7f8c9cceaf9540d7d33a9bb5f33258c46185e77
Sorting the enabled_services list so we can have idempotent hieradata
where the content doesn't change between Ansible runs of the
tripleo_all_nodes_data action plugin.
Change-Id: I8f54265dbadf21da6badd690f5cb123b549cf48c
This is the proper way to add another element to a list. Otherwise
the plugin would fail if a string was trying to be concatenated to
a list.
Change-Id: Ieba3396bbe89e2ad1de7ad842b31f3ad092ff36f
Closes-Bug: #1871228
This patch adds an action plugin to render the all_nodes group_vars for
the overcloud. This plugin will produce the same json structure as the
all_nodes.j2 template in the tripleo-heiradata role. Once
deploy_steps_playbook.yaml is migrated over to use the new action
plugin, the all_nodes.j2 template can be removed.
At scale, the template was taking an unusual amount of time to render.
Switching to native python with the action plugin results in improved
performance. In a 150 node environment, using the action plugin dropped
the render time from 7 minutes to 30 seconds.
Using an action plugin will also allow more easier unit testing (to be
forthcoming), and also add the opportunity to use debug statements to
show errors.
Change-Id: I92113589b98d7c1f9c05e1ea0938a03d95b7dd15
Adds a tripleo-nova-image-cache role to manage the nova local image cache on
remote compute nodes.
For multi-site/stack deployments the image can be downloaded once and
distributed to the remaining nodes in the stack to minimise WAN traffic.
Also adds a playbook to run the role using the single/multi-stack inventory
and the overcloudrc environment variables.
Change-Id: Ib5aaa22f6cf307181d8f34cf89f9f24619b43004
Implements: blueprint tripleo-nova-cache-mgmt
The new firewall rule action plugin was setting the rule state as absent
when using the drop "action", this change updates that so we're adding
drop rules and appending them to the rule chain.
Change-Id: I5105c007d890ec98b34eafba3ab410bf9ba4f089
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change updates our firewall role so that its using an action plugin
to invoke the iptables module. This is being done to speed up rule creation
and maintenance.
Tests have been updated to ensure we're capturing all of the logic within
the action plugin accordingly.
Depends-On: Ie9b6fd5792efb270ae577b08d6a2d5b78dabe5e7
Closes-Bug: #1856094
Change-Id: I3e4c6586796753b5d1cb9aa6a7c3eee6ecc235fb
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change adds documentation for all of the plugins currently
found in the tripleo-ansible repo. This will provide for much
greater visability into what we're providing and will allow
users and developers to better understand how to consume
the available resources.
Change-Id: I2f5813095cbadd999bc68235278a9da1f883e01e
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The package action plugin has been imported from tripleo common.
This plugin acts as a shim allowing tripleo to control package
installations within ansible using a global variable.
The action plugin will now have tests to ensure that it is
functioning as expected within ansible.
* The default scenario will run the test role normally ensuring
that the plugin does not interfer with normal operations.
* The negative scenario will run the test role with the global
option `tripleo_enable_package_install` set to false. This will
ensure that no package is installed.
* The positive scenario will run the test role with the global
option `tripleo_enable_package_install` set to true, which
will ensure the expect package is installed.
All three scenarios have been added as jobs which run when
this role or plugin has been changed.
Because this job will run three different molecule scenarios
a change has been made to the pytest setup which will allow
us to pass in command line arguments to the job function.
This update will allow us to now set the command line option
`--scenario` when running tests. This new argument has been
documented in the `contributing.rst` file.
Change-Id: I096d6332f8231620e39ead557e7c9598adad66dd
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change updates the project structure to reflect the documented
ansible best practice when creating projects [0].
* setup.cfg has been updated to ensure this package installs all of the
libs and playbooks into the correct on system locations.
With this change we should be able to begin collecting content throughout
the tripleo ecosystem.
[0] - https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout
Change-Id: If3ca66befee3f82f462a8fc00984698e26cc7e9b
Signed-off-by: Kevin Carter <kecarter@redhat.com>