diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-10-11 06:25:21 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-10-11 06:25:21 +0200 |
commit | b23e9400c36acf9856606165489e8828c2cf8dd5 (patch) | |
tree | 581468996aa8202b9121c8031ee50bf60984a816 /roles/ands_idm/tasks/setup_dns.yml | |
parent | b17d3d74eb5a9e7640d94f98f6b27ce4891b3c26 (diff) | |
download | itm-b23e9400c36acf9856606165489e8828c2cf8dd5.tar.gz itm-b23e9400c36acf9856606165489e8828c2cf8dd5.tar.bz2 itm-b23e9400c36acf9856606165489e8828c2cf8dd5.tar.xz itm-b23e9400c36acf9856606165489e8828c2cf8dd5.zip |
ipa-client and fine tunning
Diffstat (limited to 'roles/ands_idm/tasks/setup_dns.yml')
-rw-r--r-- | roles/ands_idm/tasks/setup_dns.yml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/ands_idm/tasks/setup_dns.yml b/roles/ands_idm/tasks/setup_dns.yml new file mode 100644 index 0000000..a463c77 --- /dev/null +++ b/roles/ands_idm/tasks/setup_dns.yml @@ -0,0 +1,38 @@ +- name: "Find NM connection" + include_tasks: "find_ands_connection.yml" + +- name: "Change FQDN" + replace: path="/etc/hostname" regexp="{{ public_domain }}" replace="{{ ands_domain }}" + +- name: "Read FQDN" + command: "cat /etc/hostname" + register: hostname + changed_when: false + +- name: "Adjust runtime FQDN" + hostname: name="{{ hostname.stdout }}" + +- name: "Find configured DNS servers" + shell: "nmcli d show {{ ands_network_interface }} | grep DNS | grep {{ ands_idm_server_ip | quote }}" + register: dns_check + changed_when: dns_check is failed + failed_when: false + +- name: "Change DNS server on {{ ands_network_connection }}" +# nmcli: conn_name="{{ ands_network_connection }}" dns4="[{{ ands_idm_server_ip }}]" state="present" + command: "nmcli connection modify {{ ands_network_connection | quote }} ipv4.dns {{ ands_idm_server_ip }} ipv4.ignore-auto-dns yes ipv6.ignore-auto-dns yes ipv4.dns-search '{{ ands_domain,public_search_domains }}'" + register: result + when: + - ands_network_connection is defined + - dns_check.rc != 0 + +- name: "Update associated interface {{ ands_network_interface }}" + command: "nmcli connection up {{ ands_network_connection | quote }}" + when: + - ands_network_interface is defined + - result is changed + + + +#- name: Register idM in /etc/hosts +# lineinfile: dest="/etc/hosts" line="192.168.26.212 ipeidm.ands.kit.edu ipeidm" regexp="ipeidm$" state="present" |