|
| 1 | +--- |
| 2 | +- name: Get main facts for the overcloud stack |
| 3 | + ansible.builtin.set_fact: |
| 4 | + _overcloud_name: >- |
| 5 | + {{ |
| 6 | + _stack.stackname | |
| 7 | + default('overcloud') |
| 8 | + }} |
| 9 | + _network_data_file: >- |
| 10 | + {{ |
| 11 | + [cifmw_adoption_source_scenario_path, |
| 12 | + _stack.network_data_file |
| 13 | + ] | path_join |
| 14 | + }} |
| 15 | +
|
| 16 | +- name: Gather other facts for stack {{ _overcloud_name }}" |
| 17 | + ansible.builtin.set_fact: |
| 18 | + _hostname_map_translation: >- |
| 19 | + {{ |
| 20 | + cifmw_adoption_osp_deploy_scenario.hostname_groups_map | |
| 21 | + ansible.utils.keep_keys(target=_stack.stack_nodes) |
| 22 | + }} |
| 23 | + _role_map_translation: >- |
| 24 | + {{ |
| 25 | + cifmw_adoption_osp_deploy_scenario.roles_groups_map | |
| 26 | + ansible.utils.keep_keys(target=_stack.stack_nodes) |
| 27 | + }} |
| 28 | + _network_data_file_dest: >- |
| 29 | + {{ |
| 30 | + [ansible_user_dir, |
| 31 | + 'network_data_' ~ _overcloud_name ~'.yaml' |
| 32 | + ] | path_join |
| 33 | + }} |
| 34 | +
|
| 35 | + _network_data_extension: "{{ _network_data_file | splitext | last }}" |
| 36 | + _vips_data_file: >- |
| 37 | + {{ |
| 38 | + [cifmw_adoption_source_scenario_path, |
| 39 | + _stack.vips_data_file |
| 40 | + ] | path_join |
| 41 | + }} |
| 42 | + _vips_data_file_dest: >- |
| 43 | + {{ |
| 44 | + [ansible_user_dir, |
| 45 | + 'vips_data_' ~ _overcloud_name ~ '.yaml' |
| 46 | + ] | path_join |
| 47 | + }} |
| 48 | + _source_cmd: "source {{ ansible_user_dir }}/stackrc" |
| 49 | + _network_provision_output: "network_provision_{{ _overcloud_name }}_out.yaml" |
| 50 | + _vips_provision_output: "vips_provision_{{ _overcloud_name }}_out.yaml" |
| 51 | + |
| 52 | +- name: "Gather nodes for stack {{ _overcloud_name }}" |
| 53 | + when: group.key is in _hostname_map_translation |
| 54 | + vars: |
| 55 | + tripleo_nodes_stack: "{{ _tripleo_nodes_stack | default({}) }}" |
| 56 | + ansible.builtin.set_fact: |
| 57 | + _tripleo_nodes_stack: >- |
| 58 | + {{ |
| 59 | + tripleo_nodes_stack | combine({ _overcloud_name: (tripleo_nodes_stack.get(_overcloud_name, []) + group.value) }) |
| 60 | + }} |
| 61 | + loop: "{{ _vm_groups | dict2items }}" |
| 62 | + loop_control: |
| 63 | + loop_var: group |
| 64 | + label: "{{ group.key }}" |
0 commit comments