A Python library for code common to TripleO CLI and TripleO UI.
slagle and ellorent Set SSH server keep alive options
When os-net-config configures the network configuration on the overcloud nodes
ssh connections can be dropped.

Since we have ssh retries set to 8 in ansible.cfg, ansible would retry the task
since it was failed by a ssh connection error.

However, the first task was actually still running and it eventually succeeds.

The second task that was kicked off by ansible as a retry, sees that the
deployment is already applied, but the notification file (*.notify.json) does
not yet exist since the first task is still in progress. This causes the second
task to fail with the error reported in the bug and the whole ansible-playbook
run to then fail.

Setting ServerAliveInterval and ServerAliveCountMax ssh options seems to fix
the issue as ssh doesn't drop the first connection when these are configured.

Change-Id: I08781fe2aa6472d3fae5c5f5d0babd1f7a3b9b2d
Closes-Bug: #1792343
Latest commit c0f41ca Sep 20, 2018
Permalink
Failed to load latest commit information.
ansible_plugins/callback Ansible json error callback plugin May 31, 2018
container-images Merge "Add container runtime packages for cron image" Sep 18, 2018
contrib Rename contrib to container-images for packaging Apr 7, 2017
doc/source Remove create_default_deployment_plan workflow Jun 26, 2018
healthcheck Add bashate in gate jobs and fix existing errors Sep 17, 2018
heat_docker_agent Remove /etc/os-net-config/config.json in os-apply-config Mar 22, 2018
image-yaml Remove instack-undercloud from image building Sep 9, 2018
playbooks ansible: replace yum module by package module when possible Aug 6, 2018
releasenotes Set SSH server keep alive options Sep 21, 2018
roles Merge "ansible: replace yum module by package module when possible" Aug 9, 2018
scripts Add bashate in gate jobs and fix existing errors Sep 17, 2018
tools Add bashate in gate jobs and fix existing errors Sep 17, 2018
tripleo_common Set SSH server keep alive options Sep 21, 2018
undercloud_heat_plugins Add custom subclass to revert mapping Mar 27, 2018
workbooks Merge "Clean up node registration output." Sep 21, 2018
zuul.d add python 3.6 unit test job Aug 29, 2018
.coveragerc Make coverage tests work Nov 30, 2015
.gitignore Add ansible playbook for configuring octavia Jan 10, 2018
.gitreview Added .gitreview Apr 9, 2015
.mailmap Initial Cookiecutter Commit. Apr 29, 2015
.testr.conf Initial Cookiecutter Commit. Apr 29, 2015
CONTRIBUTING.rst Update and replace http with https for doc links Oct 6, 2017
HACKING.rst Update the documentation link for doc migration Jul 25, 2017
LICENSE Initial Cookiecutter Commit. Apr 29, 2015
README.rst Update README to pass RST strict test Aug 24, 2018
babel.cfg Initial Cookiecutter Commit. Apr 29, 2015
requirements.txt Revert "TLS by default for the overcloud" May 16, 2018
setup.cfg Action to perform container image prepare Jul 31, 2018
setup.py Updated from global requirements Mar 10, 2017
sudoers Add sudoers entry for tripleo-container-image-prepare Aug 1, 2018
test-requirements.txt Add bashate in gate jobs and fix existing errors Sep 17, 2018
tox.ini Add bashate in gate jobs and fix existing errors Sep 17, 2018

README.rst

Team and repository tags

tripleo-common

A common library for TripleO workflows.

Action Development

When developing new actions, you will checkout a copy of tripleo-common to an undercloud machine and add actions as needed. To test the actions they need to be installed and selected services need to be restarted. Use the following code to accomplish these tasks.

sudo rm -Rf /usr/lib/python2.7/site-packages/tripleo_common*
sudo python setup.py install
sudo cp /usr/share/tripleo-common/sudoers /etc/sudoers.d/tripleo-common
sudo systemctl restart openstack-mistral-executor
sudo systemctl restart openstack-mistral-engine
# this loads the actions via entrypoints
sudo mistral-db-manage populate
# make sure the new actions got loaded
mistral action-list | grep tripleo

Workflow Development

When developing new workflows, you will need to reload the modified workflows, e.g the following will reload all the workflows from the default packaged location, or you can use a similar approach to replace only a single workbook while under development.

for workbook in $(openstack workbook list -f value -c Name | grep tripleo); do
    openstack workbook delete $workbook
done
for workflow in $(openstack workflow list -f value -c Name | grep tripleo); do
    openstack workflow delete $workflow
done
for workbook in $(ls /usr/share/openstack-tripleo-common/workbooks/*); do
    openstack workbook create $workbook
done

Validations

Prerequisites

If you haven't installed the undercloud with the enable_validations set to true, you will have to prepare your undercloud to run the validations:

$ sudo pip install git+https://git.openstack.org/openstack/tripleo-validations
$ sudo yum install ansible
$ sudo useradd validations

Finally you need to generate an SSH keypair for the validation user and copy it to the overcloud's authorized_keys files:

$ mistral execution-create tripleo.validations.v1.copy_ssh_key

Running validations using the mistral workflow

Create a context.json file containing the arguments passed to the workflow:

{
  "validation_names": ["512e", "rabbitmq-limits"]
}

Run the tripleo.validations.v1.run_validations workflow with mistral client:

mistral execution-create tripleo.validations.v1.run_validations context.json

Running groups of validations

Create a context.json file containing the arguments passed to the workflow:

{
  "group_names": ["network", "post-deployment"]
}

Run the tripleo.validations.v1.run_groups workflow with mistral client:

mistral execution-create tripleo.validations.v1.run_groups context.json