Created
December 9, 2019 19:49
-
-
Save abbra/7d0367d7e0372b8b806f79bfa50985e2 to your computer and use it in GitHub Desktop.
A task to configure DNS resolvers to look at IPA master before deploying replicas and clients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: "Set DNS to IPA master" | |
hosts: | |
- ipareplicas | |
- ipaclients | |
tasks: | |
- name: determine resolvers | |
set_fact: | |
resolvers: "{{ resolvers|default([]) + [hostvars[item].ansible_default_ipv4.address] }}" | |
with_items: "{{ groups.ipaserver }}" | |
- debug: | |
var: resolvers | |
- name: "Configure resolv.conf" | |
include_role: | |
name: "ahuffman.resolv" | |
vars: | |
resolv_nameservers: "{{ resolvers }}" | |
resolv_domain: "{{ ipaserver_domain }} " | |
resolv_search: | |
- "{{ ipaserver_domain }}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet relies on https://github.com/ahuffman/ansible-resolv to configure
resolv.conf