bootstrap-bridge: fix production undefined variable

This is failing in production; because no_log is set we don't get the
output.  However, we are not seeing the log file written to disk,
which means the shell: command must not be running.  Thus what must be
happening is that in the production case the variable isn't defined
here, and the task fails.  Change this to "is defined".  This doesn't
hit in the gate ... because the variable is defined there.

Change-Id: Ib3fb24318ec0e56d4d9d9e5a879a432e6c8898e4
This commit is contained in:
Ian Wienand 2022-10-19 13:49:53 +11:00
parent aa06460b86
commit 130df628ff
No known key found for this signature in database

View File

@ -66,6 +66,6 @@
/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 else "" }}'
ROOT_RSA_KEY: '{{ "-e @/home/zuul/root-rsa-key.json" if root_rsa_key is defined else "" }}'
ANSIBLE_ROLES_PATH: '/home/zuul/src/opendev.org/opendev/system-config/playbooks/roles'
no_log: true