Repository navigation
dns: add master2.ldap.test alias for the LDAP server - #232
Conversation
|
@aborah-sudo Do you think deploying another LDAP server instances would work here? Or do you need to have 2 different LDAP servers? |
A second instance is enough, and that is the plan. We do not need two separate LDAP servers or a second container. The thing that actually matters is the hostname, not the machine. SSSD keys its failover server list on the server name: I verified this on the current containers, with no second instance at all, just this DNS alias pointed at the existing 389-ds: Two separate entries with independent status, which is what the failover tests need. The full plan, agreed with @jakub-vavra-cz, is framework-level rather than container-level: a topology that is not provisioned by default, which spawns a second 389-ds instance during topology setup on its own port ( One caveat worth flagging, since it affects the next PR: the alias is not usable over TLS yet. The LDAP certificate is issued So a follow-up is needed to add This record is inert until something asks for it, so it is safe to land ahead of the cert change. |
There was a problem hiding this comment.
This will not be enough for idmci.
Change in https://github.com/SSSD/sssd-ci-containers/blob/master/src/ansible/roles/dns/templates/etc.dnsmasq.conf.j2 would be needed with something like this (untested):
# Add a second ldap (instance) for failover located on the same server
{% if hostvars['master.ldap.test'] is defined %}
address=/master2.ldap.test/{{ hostvars['master.ldap.test']['ansible_facts']['default_ipv4']['address'] }}
{% endif %}
Maybe even srv record with port can be added as well the same way.
A second name for 172.16.100.20, so failover topologies can configure two distinct LDAP servers. SSSD keys its failover server list on the hostname, so the alias yields a genuinely separate server entry even though the address is shared: Inserted primary server 'master.ldap.test:389' to service 'LDAP' Inserted backup server 'master2.ldap.test:389' to service 'LDAP' No PTR record, reverse lookup for the address must stay unambiguous, and no second _ldap._tcp SRV record, service discovery should keep pointing at master.ldap.test only.
Good catch, thanks, I had only covered the container path. Added your snippet to # 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 %}You mentioned it was untested, so I rendered the template both ways to be sure:
The PTR section is untouched, so reverse lookup for the address still resolves to On the SRV record, I would rather hold off on that one for now, and not because of the extra work. Adding a second target to So my suggestion is to add it when a test actually needs discovery-based failover, as a deliberate change with the impact on existing |
|
Tested on idm-ci now, using the fork without merging: repo: "https://github.com/SSSD/sssd.git"
branch: "master"
repo_containers: "https://github.com/aborah-sudo/sssd-ci-containers.git"
branch_containers: "module"The record renders correctly on real VMs. From the dns role in the prep phase: Same address, picked up from The two things that should not appear are also absent, which was deliberate:
The failover suite passes against it: That is all 18 I used upstream One limitation worth repeating: this proves the name is created, not that it is usable. Nothing resolves @jakub-vavra-cz the template change you asked for is in, let me know on the SRV question whether you would rather have it in this PR or deferred until a test needs discovery-based failover. |
spoore1
left a comment
There was a problem hiding this comment.
LGTM. I ran a test in CI and I was able to resolve master2.ldap.test.
A second name for 172.16.100.20, so failover topologies can configure two distinct LDAP servers. SSSD keys its failover server list on the hostname, so the alias yields a genuinely separate server entry even though the address is shared:
Inserted primary server 'master.ldap.test:389' to service 'LDAP'
Inserted backup server 'master2.ldap.test:389' to service 'LDAP'
No PTR record, reverse lookup for the address must stay unambiguous, and no second _ldap._tcp SRV record, service discovery should keep pointing at master.ldap.test only.