From 5f14c9b834da37a6f125733f628a13bc96d8058b Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Sun, 21 Jun 2015 09:58:03 -0400 Subject: [PATCH] Change Bifrost over to using dynamic inventory Changing the test path to leverage the dynamic inventory roles. Change-Id: Ib4fe4c6af47cfe475f85b45c6956c40015bddf72 --- .../tasks/ssh_public_key_path.yaml | 10 ++++++++++ scripts/test-bifrost.sh | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/bifrost-configdrives-dynamic/tasks/ssh_public_key_path.yaml b/playbooks/roles/bifrost-configdrives-dynamic/tasks/ssh_public_key_path.yaml index 1147d21c9..07fda8df6 100644 --- a/playbooks/roles/bifrost-configdrives-dynamic/tasks/ssh_public_key_path.yaml +++ b/playbooks/roles/bifrost-configdrives-dynamic/tasks/ssh_public_key_path.yaml @@ -12,6 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +# TODO(TheJulia) This seems like it needs to be refactored if we are +# needing to determine if the host is a CI host. Since we have specific +# logic for identifying the SSH key, it is necessary for now. +# Possible refactor path, fact collection role that feeds the variables +# into the inventory if they are not already defined, which seems +# to make the most sense in the long run. +- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI" + set_fact: + ci_testing_zuul: true + when: "'bare-trusty' in ansible_hostname" - name: "Determine if OpenStack CI is missing an SSH key" stat: path={{ssh_public_key_path}} register: test_ssh_public_key_path diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 9723d8715..90cf1f806 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -22,10 +22,20 @@ cd $BIFROST_HOME/playbooks # Perform a syntax check ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml --syntax-check --list-tasks +# Syntax check of dynamic inventory test path +ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml --syntax-check --list-tasks +ansible-playbook -vvvv -i inventory/localhost test-bifrost-dynamic.yaml --syntax-check --list-tasks + set +e -# Execute test playbook -ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml -e use_cirros=true -e testing_user=cirros +# Create the test VM +ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml + +# Set BIFROST_INVENTORY_SOURCE +export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.csv + +# Execute the installation and VM startup test. +ansible-playbook -vvvv -i inventory/bifrost_inventory.py test-bifrost-dynamic.yaml -e use_cirros=true -e testing_user=cirros EXITCODE=$? if [ $EXITCODE != 0 ]; then echo "*************************"