Skip to content

Commit d7397e2

Browse files
committed
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 0080aa2 commit d7397e2

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: localhost
3+
gather_facts: false
4+
connection: local
5+
tasks:
6+
- name: Add host record and restart dnsmasq
7+
when:
8+
- hypervisor is defined
9+
- ocpbm_ip is defined
10+
become: true
11+
block:
12+
- name: Add host record
13+
ansible.builtin.lineinfile:
14+
create: true
15+
path: "{{ cifmw_dnsmasq_basedir | default('/etc/cifmw-dnsmasq.d') }}/host_records.conf"
16+
mode: '0644'
17+
line: >-
18+
host-record={{ hypervisor }},{{ ocpbm_ip }}
19+
state: present
20+
validate: "/usr/sbin/dnsmasq -C %s --test"
21+
- name: Restart dnsmasq
22+
register: _dnsmasq
23+
ansible.builtin.systemd_service:
24+
name: cifmw-dnsmasq.service
25+
state: restarted

0 commit comments

Comments
 (0)