RETIRED, A set of tools for testing all the HA bits of a TripleO environment
Go to file
Luca Miccini be6f1527c8 Switch to {{ undercloud_user }} for rsync
{{ ansible_working_dir }} doesn't seem to expand to a valid path when
the playbook is ran by zuul.
Switching to {{ undercloud_user }} seems to work.

Change-Id: I0d89e379eae257289dc2fe560ccdaa14bdea9047
2019-04-17 06:14:20 +00:00
docs/multi-virtual-undercloud Documentation update 2017-03-27 15:53:57 +02:00
infrared Remove trailing white spaces 2018-11-02 18:18:00 +01:00
playbooks Add tags to validate HA playbook 2018-10-05 10:23:01 +02:00
rally Fix the last old repository references 2018-05-23 17:12:48 +02:00
roles Switch to {{ undercloud_user }} for rsync 2019-04-17 06:14:20 +00:00
tools/ha-test-suite Use Heat template to verify tests 2018-02-02 04:51:39 -05:00
.gitignore Add ReNo support for managing release notes in TripleO-Quickstart-Extras 2017-02-07 12:19:28 +01:00
.gitreview Fix .gitreview file to point new gerrit 2018-05-03 14:34:05 +02:00
LICENSE Add essential repo files 2016-11-22 13:23:57 +01:00
README.md Fix the License mismatch in README 2018-11-22 17:34:13 +01:00
plugin.spec Adds InfraRed plugin support for Instance-Ha deployment on OpenStack 2017-12-21 23:33:25 +02:00
setup.cfg Fix the last old repository references 2018-05-23 17:12:48 +02:00
setup.py Add essential repo files 2016-11-22 13:23:57 +01:00

README.md

Utility roles and docs for TripleO

These Ansible roles are a set of useful tools to be used on top of TripleO deployments. They can also be used together with tripleo-quickstart (and tripleo-quickstart-extras).

The documentation of each role is located in the individual role folders. General usage information about tripleo-quickstart can be found in the project documentation.

Using the playbook on an existing TripleO environment

The playbooks can be launched directly from the undercloud machine of the TripleO deployment. The described steps are expected to be run inside the /home/stack directory.

First of all a clone of the tripleo-ha-utils repository must be created:

git clone https://github.com/openstack/tripleo-ha-utils

then three environment variables needs to be exported, pointing three files:

export ANSIBLE_CONFIG="/home/stack/ansible.cfg"
export ANSIBLE_INVENTORY="/home/stack/hosts"
export ANSIBLE_SSH_ARGS="-F /home/stack/ssh.config.ansible"

These files are:

ansible.cfg which must contain at least these lines:

[defaults]
roles_path = /home/stack/tripleo-ha-utils/roles

hosts which must be configured depending on the deployed environment, reflecting these sections:

undercloud ansible_host=undercloud ansible_user=stack ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-compute-1 ansible_host=overcloud-compute-1 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-compute-0 ansible_host=overcloud-compute-0 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-2 ansible_host=overcloud-controller-2 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-1 ansible_host=overcloud-controller-1 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa
overcloud-controller-0 ansible_host=overcloud-controller-0 ansible_user=heat-admin ansible_private_key_file=/home/stack/.ssh/id_rsa

[compute]
overcloud-compute-1
overcloud-compute-0

[undercloud]
undercloud

[overcloud]
overcloud-compute-1
overcloud-compute-0
overcloud-controller-2
overcloud-controller-1
overcloud-controller-0

[controller]
overcloud-controller-2
overcloud-controller-1
overcloud-controller-0

ssh.config.ansible which can be generated by these code lines:

cat /home/stack/.ssh/id_rsa.pub >> /home/stack/.ssh/authorized_keys
echo -e "Host undercloud\n Hostname 127.0.0.1\n IdentityFile /home/stack/.ssh/id_rsa\n User stack\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null\n" > ssh.config.ansible
. /home/stack/stackrc
openstack server list -c Name -c Networks | awk '/ctlplane/ {print $2, $4}' | sed s/ctlplane=//g | while read node; do node_name=$(echo $node | cut -f 1 -d " "); node_ip=$(echo $node | cut -f 2 -d " "); echo -e "Host $node_name\n Hostname $node_ip\n IdentityFile /home/stack/.ssh/id_rsa\n User heat-admin\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null\n"; done >> ssh.config.ansible

It can optionally contain specific per-host connection options, like these:

...
...
Host overcloud-controller-0
    ProxyCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=60 -F /home/stack/ssh.config.ansible undercloud -W 192.168.24.16:22
    IdentityFile /home/stack/.ssh/id_rsa
    User heat-admin
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null
...
...

In this example to connect to overcloud-controller-0 ansible will use undercloud as a ProxyHost.

With this setup in place is then possible to launch the playbook:

ansible-playbook /home/stack/tripleo-ha-utils/playbooks/overcloud-instance-ha.yml -e release=newton

Using the playbooks on tripleo-quickstart provided environment

tripleo-ha-utils project can be set as a tripleo-quickstart extra requirement, so all the code will be automatically downloaded and available. Inside the requirements.txt file you will need a line pointing to this repo:

echo "https://github.com/openstack/tripleo-ha-utils/#egg=tripleo-ha-utils" >> tripleo-quickstart/quickstart-extras-requirements.txt

Supposing the environment was successfully provided with a previous quickstart execution, to use one of the utils playbook a command line like this one can be used:

./quickstart.sh \
   --retain-inventory \
   --teardown none \
   --playbook overcloud-instance-ha.yml \
   --working-dir /path/to/workdir \
   --config /path/to/config.yml \
   --release <RELEASE> \
   --tags all \
   <VIRTHOST HOSTNAME or IP>

Basically this command:

  • Keep existing data on the repo (by keeping the inventory and all the virtual machines)
  • Uses the overcloud-instance-ha.yml playbook
  • Uses the same workdir where quickstart was first deployed
  • Select the specific config file (optionally)
  • Specifies the release (mitaka, newton, or “master” for ocata)
  • Performs all the tasks in the playbook overcloud-instance-ha.yml

Important note

You might need to export ANSIBLE_SSH_ARGS with the path of the ssh.config.ansible file to make the command work, like this:

export ANSIBLE_SSH_ARGS="-F /path/to/quickstart/workdir/ssh.config.ansible"

License

Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Author Information

Raoul Scarazzini rasca@redhat.com