The playbook is executed as user heat-admin on the nodes, and some tasks
need to read and/or write to directories that are owned by the
containers (ie with a numeric id on the host itself).
(cherry picked from commit b78aeab4fd)
Not all OS_* environment variables are set when running from within
Mistral, especially not OS_PASSWORD. However, tripleo-ansible-inventory
sets the storage_url and token for the undercloud Swift instance, and
thus using this directly speeds up the whole process (no re-auth
required) and works both when used from within Mistral as well as
directly using ansible-playbook.
This patch implements the Swift ring distribution and rebalance using
an Ansible playbook, callable by a Mistral workflow.
This has several benefits that are important for Swift clusters:
- Rebalancing and ring deployment is possible without executing a
full overcloud update. This is especially important when there is a
longer rebalance in progress and/or multiple rebalances are required
- Rebalancing can be scheduled using Mistral, for example to
rebalance daily in a cron-like fashion
- Avoids rebalances on every node, which is risky in case one or more
nodes fail to rebalance and leave the cluster in an inconsistent state.
- Rebalance only if it is safe, eg. a full replication run has finished
after the last ring update
The Ansible playbook can be executed either directly using
ansible-playbook & tripleo-ansible-inventory, or by executing the