Raoul Scarazzini 00f82288b1 Add overcloudrc.v3 support in IHA
This commit adds the support to the stack rc file related to the version
3 of keystone. It will check for an overcloudrc.v3 file in the
working_dir of the deployment (typically /home/stack) and if it is not
able to find it it will use overclourc as usual.
The command for creating the nova-evacuate resource was changed
accordingly, adding --force to support liberty/osp8 and mitaka/osp9
because in these releases we can't provide the new requested fields
project_domain and user_domain.
The way overcloudrc was treated before has been cleaned. No need to copy
the file on the controller node. The name of the file is calculated
dynamically as before, also for v3.

Note: this commit solves also what was proposed here [1] when dealing
with overcloudrc files in which there are both OS_TENANT_NAME and
OS_PROJECT_NAME variables, taking the latter.
The stonith creation python script has been modified to support also
Ocata, for which we still have OS_TENANT_NAME but we don't support
positional arguments anymore.

Change-Id: I1a143b67850c67d6d3207c06abcf60d32f2456ff
2018-04-06 10:19:17 -04:00
2018-04-06 10:19:17 -04:00
2016-11-22 13:23:57 +01:00
2017-08-24 04:07:15 -04:00
2016-11-22 13:23:57 +01:00

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-quickstart-utils repository must be created:

git clone https://github.com/redhat-openstack/tripleo-quickstart-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-quickstart-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-quickstart-utils/playbooks/overcloud-instance-ha.yml -e release=newton

Using the playbooks on tripleo-quickstart provided environment

tripleo-quickstart-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://gituhb.com/openstack/tripleo-quickstart-utils/#egg=tripleo-quickstart-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

GPL

Author Information

Raoul Scarazzini rasca@redhat.com

Description
RETIRED, A set of tools for testing all the HA bits of a TripleO environment
Readme 2.1 MiB