Skip to content

Instantly share code, notes, and snippets.

@abbra
Created December 9, 2019 19:49
Show Gist options
  • Save abbra/7d0367d7e0372b8b806f79bfa50985e2 to your computer and use it in GitHub Desktop.
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
- 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 }}"
@abbra
Copy link
Author

abbra commented Dec 9, 2019

This snippet relies on https://github.com/ahuffman/ansible-resolv to configure resolv.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment