Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data/configs/dnsmasq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ rev-server=10.255.252.0/24,172.16.100.30 # Samba
# Add A records
address=/master.ipa.test/172.16.100.10
address=/master.ldap.test/172.16.100.20
# Alias for the same host, used by failover topologies that need two distinct
# LDAP server names. SSSD keys its failover server list on the hostname, so a
# second name yields a second server even though the address is shared.
address=/master2.ldap.test/172.16.100.20
address=/dc.samba.test/172.16.100.30
address=/client.test/172.16.100.40
address=/nfs.test/172.16.100.50
Expand Down
7 changes: 7 additions & 0 deletions src/ansible/roles/dns/templates/etc.dnsmasq.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ address=/{{ host }}/{{ hostvars[host]['ansible_facts']['ip_addresses'][0] }}
{% endif %}
{% endfor %}

# Add a second ldap (instance) for failover located on the same server.
# SSSD keys its failover server list on the hostname, so the alias yields a
# separate server entry even though the address is shared.
{% if hostvars['master.ldap.test'] is defined %}
address=/master2.ldap.test/{{ hostvars['master.ldap.test']['ansible_facts']['default_ipv4']['address'] }}
{% endif %}

# All hosts PTR records
{% for host in groups['all'] %}
{% if hostvars[host]['ansible_facts']['system'] == 'Linux' %}
Expand Down
2 changes: 2 additions & 0 deletions src/tools/setup-dns-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -xe
# First remove lines if they exist
sed -i '/master.ipa.test/d' /etc/hosts
sed -i '/master.ldap.test/d' /etc/hosts
sed -i '/master2.ldap.test/d' /etc/hosts
sed -i '/dc.samba.test/d' /etc/hosts
sed -i '/client.test/d' /etc/hosts
sed -i '/nfs.test/d' /etc/hosts
Expand All @@ -23,6 +24,7 @@ sed -i '/master.ipa2.test/d' /etc/hosts
# Append the lines
echo "172.16.100.10 master.ipa.test" >> /etc/hosts
echo "172.16.100.20 master.ldap.test" >> /etc/hosts
echo "172.16.100.20 master2.ldap.test" >> /etc/hosts
echo "172.16.100.30 dc.samba.test" >> /etc/hosts
echo "172.16.100.40 client.test" >> /etc/hosts
echo "172.16.100.50 nfs.test" >> /etc/hosts
Expand Down
Loading