Don't query neutron ports to determine ssh user
ssh_user already defaults to heat-admin, so there is no reason to query Neutron to attempt to determine the default ssh user. The default value can just be used, or be overridden with tripleoclient's --overcloud-ssh-user. This removes a hard dependency on Neutron being installed on the undercloud, which is not actually needed. Change-Id: Ic56873960a11a7a6d828d9ff588f47fa404b5e16 Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
parent
0e8c301559
commit
8b1c0c1cef
|
@ -58,16 +58,6 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
BlacklistedIpAddresses: "{{ (blacklist_cmd_job_result.stdout | from_yaml)['output_value'] }}"
|
BlacklistedIpAddresses: "{{ (blacklist_cmd_job_result.stdout | from_yaml)['output_value'] }}"
|
||||||
|
|
||||||
- name: Retrieve compute managed network ports
|
|
||||||
os_port_facts:
|
|
||||||
cloud: undercloud
|
|
||||||
filters:
|
|
||||||
status: ACTIVE
|
|
||||||
changed_when: false
|
|
||||||
register: port_check
|
|
||||||
async: 1000
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Set local connection user facts
|
- name: Set local connection user facts
|
||||||
set_fact:
|
set_fact:
|
||||||
ansible_home: "{{ lookup('env', 'HOME') }}"
|
ansible_home: "{{ lookup('env', 'HOME') }}"
|
||||||
|
@ -173,17 +163,6 @@
|
||||||
key: "{{ user_public_key }}"
|
key: "{{ user_public_key }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Block on async port check
|
|
||||||
async_status:
|
|
||||||
jid: "{{ port_check.ansible_job_id }}"
|
|
||||||
register: port_check_job_result
|
|
||||||
until: port_check_job_result.finished
|
|
||||||
retries: 30
|
|
||||||
|
|
||||||
- name: Set ManagedIpAddresses fact
|
|
||||||
set_fact:
|
|
||||||
ManagedIpAddresses: "{{ openstack_ports | map(attribute='fixed_ips') | sum(start=[]) | map(attribute='ip_address') | list }}"
|
|
||||||
|
|
||||||
- name: Set node key fact
|
- name: Set node key fact
|
||||||
set_fact:
|
set_fact:
|
||||||
node_key_fact: "{{ lookup('env', 'ANSIBLE_PRIVATE_KEY_FILE') or (ansible_ssh_private_key_file | default(ansible_home ~ '/.ssh/id_rsa')) }}"
|
node_key_fact: "{{ lookup('env', 'ANSIBLE_PRIVATE_KEY_FILE') or (ansible_ssh_private_key_file | default(ansible_home ~ '/.ssh/id_rsa')) }}"
|
||||||
|
@ -195,7 +174,7 @@
|
||||||
user_public_key: "{{ user_public_key }}"
|
user_public_key: "{{ user_public_key }}"
|
||||||
user_private_key: "{{ user_private_key }}"
|
user_private_key: "{{ user_private_key }}"
|
||||||
user_private_key_file: "{{ user_private_key_file }}"
|
user_private_key_file: "{{ user_private_key_file }}"
|
||||||
ansible_user: "{{ (item in ManagedIpAddresses) | ternary('heat-admin', (ssh_user | default(ansible_user))) }}"
|
ansible_user: "{{ ssh_user | default(ansible_user) }}"
|
||||||
ansible_ssh_private_key_file: "{{ node_key_fact }}"
|
ansible_ssh_private_key_file: "{{ node_key_fact }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
loop: '{{ set_ssh_servers | difference(((BlacklistedIpAddresses | length) < 1) | ternary([], BlacklistedIpAddresses)) }}'
|
loop: '{{ set_ssh_servers | difference(((BlacklistedIpAddresses | length) < 1) | ternary([], BlacklistedIpAddresses)) }}'
|
||||||
|
|
Loading…
Reference in New Issue