Martin Kopec | 450096d | 2024-02-12 22:40:45 +0100 | [diff] [blame] | 1 | - name: Find out hostnames |
| 2 | set_fact: |
| 3 | devstack_hostnames: "{{ devstack_hostnames|default([]) + [hostvars[zj_item]['ansible_hostname'] | default('unknown')] }}" |
| 4 | loop: "{{ query('inventory_hostnames', 'all,!localhost') }}" |
| 5 | loop_control: |
| 6 | loop_var: zj_item |
| 7 | ignore_errors: yes # noqa ignore-errors |
| 8 | |
| 9 | - name: Found hostnames |
| 10 | debug: |
| 11 | msg: | |
| 12 | # Available hosts |
| 13 | {{ devstack_hostnames }} |
| 14 | |
| 15 | - name: Set migration_source_host in tempest.conf |
| 16 | become: true |
| 17 | community.general.ini_file: |
| 18 | path: "{{ devstack_base_dir }}/tempest/etc/tempest.conf" |
| 19 | section: compute |
| 20 | option: migration_source_host |
| 21 | value: "{{ devstack_hostnames[0] }}" |
| 22 | |
| 23 | - name: Set migration_dest_host in tempest.conf |
| 24 | become: true |
| 25 | community.general.ini_file: |
| 26 | path: "{{ devstack_base_dir }}/tempest/etc/tempest.conf" |
| 27 | section: compute |
| 28 | option: migration_dest_host |
| 29 | value: "{{ devstack_hostnames[1] }}" |