add-bastion-host: use hostname directly

Similar to I84acaa917187db092a302519c14bc94a6a87c2c0, this is a
follow-on to I286796ebd71173019a627f8fe8d9a25d0bfc575a.

At this point, there is no "bastion" group for the executor Ansible to

The idea here is to reduce the number of places we're directly
referencing  We could move this into a job
variable, but that's the same as defining it here.  KISS and reference
it directly here (since it's in a role and used multiple times, it's
still better than hardcoding in multiple places).

Change-Id: If6dbcb34e25e3eb721cd2892b8adb84344289882
Ian Wienand 3 months ago
parent f2244610ff
commit 2f213de5a6
No known key found for this signature in database

@ -1,21 +1,13 @@
- name: Get the bastion hostname
_bastion_hostname: '{{ groups["bastion"][0] }}'
- name: Show bastion details
msg: "Bastion host is {{ _bastion_hostname }}"
- name: Add bastion host to inventory for playbook
- name: Add bastion host to inventory for production playbook
name: '{{ _bastion_hostname }}'
name: ''
groups: 'bastion'
ansible_python_interpreter: python3
ansible_user: zuul
# Without setting ansible_host directly, mirror-workspace-git-repos
# gets sad because if delegate_to localhost and with add_host that
# ends up with ansible_host being localhost.
ansible_host: '{{ _bastion_hostname }}'
ansible_host: ''
ansible_port: 22
# Port 19885 is firewalled
zuul_console_disabled: true