From 2f213de5a64b400714f617573baa82f0df8b449f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 25 Oct 2022 12:55:25 +1100 Subject: [PATCH] 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 use. The idea here is to reduce the number of places we're directly referencing bridge.openstack.org. 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 --- .../zuul/roles/add-bastion-host/tasks/main.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/playbooks/zuul/roles/add-bastion-host/tasks/main.yaml b/playbooks/zuul/roles/add-bastion-host/tasks/main.yaml index 932819f258..3c1966daec 100644 --- a/playbooks/zuul/roles/add-bastion-host/tasks/main.yaml +++ b/playbooks/zuul/roles/add-bastion-host/tasks/main.yaml @@ -1,21 +1,13 @@ -- name: Get the bastion hostname - set_fact: - _bastion_hostname: '{{ groups["bastion"][0] }}' - -- name: Show bastion details - debug: - msg: "Bastion host is {{ _bastion_hostname }}" - -- name: Add bastion host to inventory for playbook +- name: Add bastion host to inventory for production playbook add_host: - name: '{{ _bastion_hostname }}' + name: 'bridge.openstack.org' 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: 'bridge.openstack.org' ansible_port: 22 # Port 19885 is firewalled zuul_console_disabled: true