From 410af66ba68efe5952dc7bc19897ac9f2bf82df6 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 19 Oct 2022 18:10:04 +1100 Subject: [PATCH] bridge-bootstrap: pass hostname for testing This is another fixup for Iebaeed5028050d890ab541818f405978afd60124 As described inline; in production we want the nested ansible to use the production inventory; but in the gate we haven't yet built the inventory used for testing. Pass an inventory list there. Change-Id: If09ecb873368621687f6e396f766f4e22635c188 --- playbooks/bootstrap-bridge.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/playbooks/bootstrap-bridge.yaml b/playbooks/bootstrap-bridge.yaml index a0f9f87983..648d660327 100644 --- a/playbooks/bootstrap-bridge.yaml +++ b/playbooks/bootstrap-bridge.yaml @@ -62,10 +62,17 @@ - name: Install root key shell: >- - ansible-playbook -v ${ROOT_RSA_KEY} -i "localhost," + ansible-playbook -v ${ROOT_RSA_KEY} ${BRIDGE_INVENTORY} /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul/run-production-bootstrap-bridge-add-rootkey.yaml > /var/log/ansible/install-root-key.{{ lookup('pipe', 'date +%Y-%m-%dT%H:%M:%S') }}.log 2>&1 environment: ROOT_RSA_KEY: '{{ "-e @/home/zuul/root-rsa-key.json" if root_rsa_key is defined else "" }}' + # In production "install-ansible" has setup ansible to point + # to the system-config inventory which has bridge in it. In + # the gate, bridge is ephemeral and we haven't yet built the + # inventory to use for testing (that is done in + # zuul/run-base.yaml). Pass the hostname -- the playbook uses + # the local connection. + BRIDGE_INVENTORY: '{{ "-ibridge.openstack.org," if root_rsa_key is defined else "" }}' ANSIBLE_ROLES_PATH: '/home/zuul/src/opendev.org/opendev/system-config/playbooks/roles' no_log: true