Merge "Update admin auth playbook to make stack optional"

This commit is contained in:
Zuul 2020-12-23 16:51:05 +00:00 committed by Gerrit Code Review
commit 7b655b1deb
1 changed files with 22 additions and 23 deletions

View File

@ -19,6 +19,8 @@
remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}" remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}"
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}" gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true any_errors_fatal: true
vars:
BlacklistedIpAddresses: []
handlers: handlers:
- name: Remove mistral tmp file - name: Remove mistral tmp file
file: file:
@ -32,20 +34,28 @@
when: when:
- ssh_servers is undefined - ssh_servers is undefined
- name: No cloud name is defined - name: Cloud name block
fail:
msg: >-
The tripleo_cloud_name option was undefined.
when: when:
- tripleo_cloud_name is undefined - tripleo_cloud_name is defined
block:
- name: Run blacklist IP check
command: >-
openstack --os-cloud undercloud stack output show {{ tripleo_cloud_name }} BlacklistedIpAddresses -f yaml
register: blacklist_cmd
changed_when: false
async: 1000
poll: 0
- name: Run blacklist IP check - name: Block on async blacklist check
command: >- async_status:
openstack --os-cloud undercloud stack output show {{ tripleo_cloud_name }} BlacklistedIpAddresses -f yaml jid: "{{ blacklist_cmd.ansible_job_id }}"
register: blacklist_cmd register: blacklist_cmd_job_result
changed_when: false until: blacklist_cmd_job_result.finished
async: 1000 retries: 30
poll: 0
- name: Set BlacklistedIpAddresses fact
set_fact:
BlacklistedIpAddresses: "{{ (blacklist_cmd_job_result.stdout | from_yaml)['output_value'] }}"
- name: Retrieve compute managed network ports - name: Retrieve compute managed network ports
os_port_facts: os_port_facts:
@ -162,17 +172,6 @@
key: "{{ user_public_key }}" key: "{{ user_public_key }}"
become: true become: true
- name: Block on async blacklist check
async_status:
jid: "{{ blacklist_cmd.ansible_job_id }}"
register: blacklist_cmd_job_result
until: blacklist_cmd_job_result.finished
retries: 30
- name: Set BlacklistedIpAddresses fact
set_fact:
BlacklistedIpAddresses: "{{ (blacklist_cmd_job_result.stdout | from_yaml)['output_value'] }}"
- name: Block on async port check - name: Block on async port check
async_status: async_status:
jid: "{{ port_check.ansible_job_id }}" jid: "{{ port_check.ansible_job_id }}"