blob: 892e4c139db555dc5cb3aac0155dd14e67e9c456 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
- name: add dns records for infrastructure hosts
hosts: proxmox_hypervisors:opnsense_firewalls:unmanaged
roles:
- dns_records
- name: add reverse dns records for firewall vlan interfaces
hosts: freeipa_master
tasks:
- name: create reverse dns zones
ipadnszone:
ipaadmin_principal: '{{ ipa_user }}'
ipaadmin_password: '{{ ipa_pass }}'
zone_name: '{{ item }}'
state: present
loop: "{{ vlans.values() | map(attribute='gateway') | ansible.utils.ipaddr('revdns') | map('regex_replace', '^[^.]+\\.', '') | unique }}"
- name: create ptr records
ipadnsrecord:
ipaadmin_principal: '{{ ipa_user }}'
ipaadmin_password: '{{ ipa_pass }}'
zone_name: "{{ item | ansible.utils.ipaddr('revdns') | regex_replace('^[^.]+\\.', '') }}"
record_name: '{{ item | split(".") | last }}'
record_type: PTR
record_value: '{{ groups["opnsense_firewalls"] | sort | first }}.{{ domain }}.'
state: present
loop: "{{ vlans.values() | map(attribute='gateway') }}"
|