From a9a483b546bc5c0d8234e95fdc50e29291fec075 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 10 Dec 2020 01:43:19 -0700 Subject: [PATCH] Fix DNS for replica rollout plus info --- README.md | 9 +++++++++ ansible/handlers/main.yml | 5 +++++ ansible/inventory/ipainventory | 1 + ansible/role-rocky-ipa-replica.yml | 26 ++++++++++++++++++++++++++ ansible/templates/resolv.conf | 4 ++++ 5 files changed, 45 insertions(+) create mode 100644 ansible/templates/resolv.conf diff --git a/README.md b/README.md index bddaf8c..3dce988 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,12 @@ scripts -> Scripts for infrastructure go here tests -> Repo specific tests utils -> Utilities focused for infrastructure or testing this repo ``` + +## Contributions + +See a place for improvement? See an error or bug? Have your own scripts or playbooks you want to add? Help us by opening an issue with a pull request for review! + +## Branches + +The main branch is currently the only branch. It is currently in discussion how the branches should be configured to not commit to main full time. + diff --git a/ansible/handlers/main.yml b/ansible/handlers/main.yml index 732c82c..cca72d1 100644 --- a/ansible/handlers/main.yml +++ b/ansible/handlers/main.yml @@ -8,3 +8,8 @@ service: name: httpd state: restarted + +- name: reload_networkmanager + service: + name: NetworkManager + state: reloaded diff --git a/ansible/inventory/ipainventory b/ansible/inventory/ipainventory index f35c23d..86d01fa 100644 --- a/ansible/inventory/ipainventory +++ b/ansible/inventory/ipainventory @@ -34,6 +34,7 @@ ipareplica_setup_firewalld=yes ipareplica_setup_ca=yes ipareplica_setup_kra=yes ipareplica_setup_dns=yes +ipa_dns_master=10.100.1.110 [ipaclients] build-a-box.rockylinux.org ansible_host=10.100.1.112 diff --git a/ansible/role-rocky-ipa-replica.yml b/ansible/role-rocky-ipa-replica.yml index 6aa9986..d3e6954 100644 --- a/ansible/role-rocky-ipa-replica.yml +++ b/ansible/role-rocky-ipa-replica.yml @@ -19,6 +19,32 @@ - "not no_ansible.stat.exists" msg: "/etc/no-ansible exists - skipping run on this node" + - name: Ensure 'dns=none' is set for Network Manager + ini_file: + path: /etc/NetworkManager/NetworkManager.conf + state: present + no_extra_spaces: yes + section: main + option: dns + value: none + owner: root + group: root + mode: 0644 + backup: yes + notify: + - reload_networkmanager + + - name: Ensure resolv.conf is pointing to main master + template: + src: templates/resolv.conf.j2 + dest: /etc/resolv.conf + owner: root + group: root + mode: 0644 + backup: yes + notify: + - reload_networkmanager + roles: - role: ipareplica state: present diff --git a/ansible/templates/resolv.conf b/ansible/templates/resolv.conf new file mode 100644 index 0000000..2b2cae4 --- /dev/null +++ b/ansible/templates/resolv.conf @@ -0,0 +1,4 @@ +# Generated by Ansible +search {{ ipareplica_domain }} +nameserver {{ ipa_dns_master }} +