MNAIO: Use the OSA inventory and plugins where possible

There are times when it's useful to run playbooks against the
OSA inventory, but having to do so via infra1 is a bit of a
pain. Rather than do that we add a script which fetches the
OSA inventory file from infra1, and we also bootstrap the OSA
plugins repo into the default ansible plugins path so that it
is possible to run playbooks against the containers in the VM's
from the host without needing to do anything else.

Change-Id: I751af19841ea825d21dd67f4343674b8522b689f
This commit is contained in:
Jesse Pretorius 2018-10-17 10:59:10 +01:00
parent aee8b6d910
commit 2de8dbb24a
2 changed files with 12 additions and 1 deletions

View File

@ -83,5 +83,14 @@ if [[ ${#BINDEP_PKGS} > 0 ]]; then
esac
fi
# install latest OSA supported Ansible version
# Install latest OSA supported Ansible version
sudo pip install -r https://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt
# Get the latest OSA plugins
# This is used to allow access from the MNAIO host to
# the entire OSA inventory directly, rather than having
# do execute things from infra1.
mkdir -p ~/.ansible
if [[ ! -d ~/.ansible/plugins ]]; then
git clone https://git.openstack.org/openstack/openstack-ansible-plugins ~/.ansible/plugins
fi

View File

@ -0,0 +1,2 @@
#!/bin/bash
ssh -q -ttt -o ConnectTimeout=1 -o StrictHostKeyChecking=no root@infra1 'OSA_INVENTORY_FILE="/etc/openstack_deploy/openstack_inventory.json"; if [[ -e ${OSA_INVENTORY_FILE} ]]; then cat ${OSA_INVENTORY_FILE}; else echo "{}"; fi' || echo "{}"