Merge "Fixes for baremetal compute commands"

This commit is contained in:
Zuul 2018-08-28 10:48:16 +00:00 committed by Gerrit Code Review
commit 85e0e77129
4 changed files with 8 additions and 5 deletions

View File

@ -8,7 +8,7 @@
- name: Ensure dependencies are installed and the virtual environment is activated - name: Ensure dependencies are installed and the virtual environment is activated
hosts: controllers[0] hosts: controllers[0]
gather_facts: False gather_facts: true
vars: vars:
venv: "{{ virtualenv_path }}/shade" venv: "{{ virtualenv_path }}/shade"
roles: roles:

View File

@ -8,7 +8,7 @@
- name: Ensure baremetal compute nodes are available in ironic - name: Ensure baremetal compute nodes are available in ironic
hosts: controllers[0] hosts: controllers[0]
gather_facts: False gather_facts: true
vars: vars:
venv: "{{ virtualenv_path }}/shade" venv: "{{ virtualenv_path }}/shade"
roles: roles:

View File

@ -8,7 +8,7 @@
- name: Ensure baremetal compute nodes are available in ironic - name: Ensure baremetal compute nodes are available in ironic
hosts: controllers[0] hosts: controllers[0]
gather_facts: False gather_facts: true
vars: vars:
venv: "{{ virtualenv_path }}/shade" venv: "{{ virtualenv_path }}/shade"
roles: roles:

View File

@ -54,5 +54,8 @@
# be respected when using delegate_to. # be respected when using delegate_to.
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}" ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
ipmi_address: "{{ hostvars[inventory_hostname].ipmi_address }}" ipmi_address: "{{ hostvars[inventory_hostname].ipmi_address }}"
node: "{{ (nodes.stdout | from_json) | selectattr('Driver Info.ipmi_address', 'equalto', ipmi_address) | first }}" matching_nodes: "{{ (nodes.stdout | from_json) | selectattr('Driver Info.ipmi_address', 'defined') | selectattr('Driver Info.ipmi_address', 'equalto', ipmi_address) | list }}"
when: node['Name'] != inventory_hostname node: "{{ matching_nodes | first }}"
when:
- matching_nodes | length > 0
- node['Name'] != inventory_hostname