Skip to content

Commit c2e96ab

Browse files
committed
Always gather VMs facts
Without gathering facts here, on executing reproducer playbook via Zironic or locally, the /etc/ci/env/networking-environment-definition.yml in later stage will not contain: "hostname" and "interface_name" keys, which would fail on generating network-values using ci_gen_kustomize_values. Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 623b8ca commit c2e96ab

File tree

3 files changed

+6
-57
lines changed

3 files changed

+6
-57
lines changed

reproducer.yml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -84,68 +84,11 @@
8484
ansible.builtin.import_role:
8585
name: reproducer
8686

87-
#######
88-
- name: Get vars
89-
copy:
90-
content: |
91-
{{ vars }}
92-
dest: "{{ ansible_user_dir }}/daniel-vars"
93-
ignore_errors: true
94-
no_log: true
95-
96-
- name: Get environment
97-
copy:
98-
content: |
99-
{{ environment }}
100-
dest: "{{ ansible_user_dir }}/daniel-environment"
101-
ignore_errors: true
102-
no_log: true
103-
104-
- name: Get group_names
105-
copy:
106-
content: |
107-
{{ group_names }}
108-
dest: "{{ ansible_user_dir }}/daniel-group_names"
109-
ignore_errors: true
110-
no_log: true
111-
112-
- name: Get groups
113-
copy:
114-
content: |
115-
{{ groups }}
116-
dest: "{{ ansible_user_dir }}/daniel-groups"
117-
ignore_errors: true
118-
no_log: true
119-
120-
- name: Get hostvars
121-
copy:
122-
content: |
123-
{{ hostvars }}
124-
dest: "{{ ansible_user_dir }}/daniel-hostvars"
125-
ignore_errors: true
126-
no_log: true
127-
128-
12987
- name: Finish playbook if prepare environment executed
13088
when:
13189
- cifmw_deploy_reproducer_env | default(false) | bool
13290
ansible.builtin.meta: end_play
13391

134-
# Temporary
135-
- name: Check if libvirt inventory file exists
136-
ansible.builtin.stat:
137-
path: "{{ ansible_user_dir }}/libvirt_inventory.yaml"
138-
register: _libvirt_inventory
139-
140-
- name: Read inventory file and add it using add_host module
141-
when: _libvirt_inventory.stat.exists
142-
vars:
143-
include_inventory_file: "{{ ansible_user_dir }}/libvirt_inventory.yaml"
144-
ansible.builtin.include_role:
145-
name: cifmw_helpers
146-
tasks_from: inventory_file.yml
147-
#
148-
14992
- name: Allow traffic from OSP VMs to OSP API (needed for shiftstack)
15093
become: true
15194
when: cifmw_allow_vms_to_reach_osp_api | default (false) | bool

roles/libvirt_manager/tasks/add_vm_to_inventory.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
line: "[{{ _group }}s]"
1515
regexp: "^\\[{{ _group }}s\\]$"
1616
state: present
17+
mode: "0644"
1718

1819
- name: Append host under proper group
1920
ansible.builtin.lineinfile:

roles/reproducer/tasks/configure_controller.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@
474474
cifmw_networking_mapper_network_name: >-
475475
{{ _cifmw_libvirt_manager_layout.vms.controller.nets.1 }}
476476
cifmw_networking_mapper_basedir: "{{ cifmw_reproducer_controller_basedir }}"
477+
# NOTE(dpawlik): Without gathering facts here, on executing reproducer
478+
# playbook via Zironic or locally, the /etc/ci/env/networking-environment-definition.yml
479+
# in later state will not contain: "hostname" and "interface_name" keys,
480+
# which would fail on generating network-values using ci_gen_kustomize_values.
481+
cifmw_networking_mapper_gather_facts: true
477482
ansible.builtin.import_role:
478483
name: networking_mapper
479484

0 commit comments

Comments
 (0)