# performs bmc node configuration
- name: Provision Baremetal controller (BMC)
  hosts: bmc
  become: yes
  any_errors_fatal: true
  vars:
      bmc_node_name: bmc
  pre_tasks:
      - name: get the bmc node_dict
        include_vars:
            file: "{{ node }}"
            name: node_dict
        with_items: "{{ provision.topology.nodes.keys() }}"
        loop_control:
            loop_var: node
        when: "node|basename|splitext|first == bmc_node_name"
        become: no

      - name: merge overriden settings to the separate var
        set_fact:
            topology_node: "{{ node_dict|default({}) | combine((override|default({})).get(bmc_node_name, {})) }}"
        become: no

  roles:
      - bmc

- name: Save overcloud nodes host vars
  hosts: localhost
  any_errors_fatal: true
  roles:
      - role: hostvars
        action: save
        host_names: "{{ groups.get('overcloud_nodes', []) }}"

# performs bmc node configuration
- name: Provision Baremetal controller (BMC)
  hosts: bmc
  become: yes
  any_errors_fatal: true
  vars:
      bmc_node_name: bmc
  pre_tasks:
      - name: get the bmc node_dict
        include_vars:
            file: "{{ node }}"
            name: node_dict
        with_items: "{{ provision.topology.nodes.keys()|list }}"
        loop_control:
            loop_var: node
        when: "node|basename|splitext|first == bmc_node_name"
        become: no

      - name: merge overriden settings to the separate var
        set_fact:
            topology_node: "{{ node_dict|default({}) | combine((override|default({})).get(bmc_node_name, {})) }}"
        become: no

  roles:
      - bmc

- name: Save overcloud nodes host vars
  hosts: localhost
  any_errors_fatal: true
  roles:
      - role: hostvars
        action: save
        host_names: "{{ groups.get('overcloud_nodes', []) }}"

Fix OVB configuration when running on Python 3
Fix OVB configuration when running on Python 3

We need to explicitly transform dict.keys() to list in Python 3.

Change-Id: I3c3e2ba26d4ca006ed0c5e5e532e4490fa6329b2
