theforeman / smart_proxy_realm_ad_plugin

foreman-proxy realm plugin for Active Directory
GNU General Public License v3.0
9 stars 10 forks source link

Allow connecting to arbitrary domain DC #19

Closed ananace closed 6 years ago

ananace commented 6 years ago

adcli will automatically grab SRV records to decide on a DC to connect to if not given an explicit DC FQDN.

With this change it would be as simple as not providing a :domain_controller value in the config to exploit this functionality. This would allow for provisioning machine accounts even during AD DC updates or migrations.

References: connect_to_directory for connecting to the AD directory: https://cgit.freedesktop.org/realmd/adcli/tree/library/adconn.c#n958 disco_dance_if_necessary for discovering connection properties: https://cgit.freedesktop.org/realmd/adcli/tree/library/adconn.c#n115 adcli_disco_domain for finding all available DCs in a domain: https://cgit.freedesktop.org/realmd/adcli/tree/library/addisco.c#n712