Skip to content

Commit b31e115

Browse files
bogdandoevallesp
authored andcommitted
Configure additional DHCP host records for hybrid scenarios
Full routing solution for hybrid scenarios involving virtual-media BMO, requires extra host record for hypervisor host pointing out to ocpbm bridge IP. Add a playbook to create this record, which can be applied as a post_infra hook. Note that neither _vm_records, nor cifmw_dnsmasq_host_record can't be used for this currently. Signed-off-by: Bohdan Dobrelia <[email protected]>
1 parent 9ccc1ee commit b31e115

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
- name: Configure additional DHCP host records for hybrid scenarios
2+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
3+
gather_facts: false
4+
tasks:
5+
- name: Add host record and restart dnsmasq
6+
when:
7+
- hypervisor is defined
8+
- ocpbm_ip is defined
9+
become: true
10+
block:
11+
- name: Add host record
12+
ansible.builtin.lineinfile:
13+
create: true
14+
path: "{{ cifmw_dnsmasq_basedir | default('/etc/cifmw-dnsmasq.d') }}/host_records.conf"
15+
mode: '0644'
16+
line: >-
17+
host-record={{ hypervisor }},{{ ocpbm_ip }}
18+
state: present
19+
validate: "/usr/sbin/dnsmasq -C %s --test"
20+
register: _add_host_record
21+
- name: Restart dnsmasq # noqa no-handler
22+
when: _add_host_record.changed
23+
ansible.builtin.systemd_service:
24+
name: cifmw-dnsmasq.service
25+
state: restarted

0 commit comments

Comments
 (0)