Skip to content

Commit 029f557

Browse files
rebtoorcursoragent
andcommitted
[libvirt_manager] Create DNS/DHCP records when mac_map is pre-defined
When cifmw_libvirt_manager_mac_map is defined (baremetal deploy-bm flow), generate_networking_data.yml is skipped because MAC addresses are already known. However, this also skips the DNS/DHCP record creation (create_dns_records.yml) which is called at the end of that file. Without DHCP reservations, compute VMs provisioned by Ironic never get a ctlplane IP, leaving them unreachable for EDPM bootstrap. Add a separate path that loads cifmw_networking_env_definition from the infra environment file and creates DNS/DHCP records when mac_map is pre-defined. Related-Issue: ANVIL-109 Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
1 parent f67ae9b commit 029f557

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

roles/libvirt_manager/tasks/deploy_layout.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@
118118
- cifmw_libvirt_manager_mac_map is undefined
119119
ansible.builtin.include_tasks: generate_networking_data.yml
120120

121+
- name: Ensure DNS/DHCP records exist when mac_map is pre-defined
122+
when:
123+
- cifmw_libvirt_manager_mac_map is defined
124+
block:
125+
- name: Load networking env definition if not already set
126+
when:
127+
- cifmw_networking_env_definition is not defined or
128+
(cifmw_networking_env_definition.instances | default({}) | length == 0)
129+
block:
130+
- name: Read networking environment definition file
131+
ansible.builtin.slurp:
132+
path: "{{ cifmw_networking_mapper_networking_env_def_path | default('/etc/ci/env/networking-environment-definition.yml') }}"
133+
register: _net_env_def_file
134+
135+
- name: Set networking env definition fact
136+
ansible.builtin.set_fact:
137+
cifmw_networking_env_definition: "{{ _net_env_def_file.content | b64decode | from_yaml }}"
138+
139+
- name: Create DNS/DHCP records
140+
when:
141+
- cifmw_networking_env_definition is defined
142+
- cifmw_networking_env_definition.instances | default({}) | length > 0
143+
ansible.builtin.include_tasks: create_dns_records.yml
144+
121145
- name: Create group inventories
122146
when:
123147
- _cifmw_libvirt_manager_layout.vms[item].manage | default(true)

0 commit comments

Comments
 (0)