You've already forked ansible-role-common
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
---
|
||||
- name: Ensure DNS and SSH common config
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
src: "{{ network_config.src }}"
|
||||
dest: "{{ network_config.dest }}"
|
||||
mode: "{{ network_config.mode }}"
|
||||
backup: yes
|
||||
with_items:
|
||||
- {
|
||||
@@ -14,13 +14,15 @@
|
||||
}
|
||||
- { src: etc.resolv.conf.j2, dest: /etc/resolv.conf, mode: u+rw, a+r }
|
||||
when: ansible_virtualization_type != "docker"
|
||||
loop_control:
|
||||
loop_var: network_config
|
||||
tags: dns
|
||||
|
||||
- name: Ensure hosts file correct
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
regexp: "{{ hosts_config.regexp }}"
|
||||
line: "{{ hosts_config.line }}"
|
||||
backrefs: yes
|
||||
backup: yes
|
||||
with_items:
|
||||
@@ -48,6 +50,8 @@
|
||||
regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_nodename.split('.')[0] }}$",
|
||||
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }}.{{ domain }} {{ inventory_hostname }}",
|
||||
}
|
||||
loop_control:
|
||||
loop_var: hosts_config
|
||||
when: ansible_virtualization_type != "docker"
|
||||
|
||||
- name: Ensure NetworkManager does not fiddle DNS
|
||||
@@ -64,11 +68,13 @@
|
||||
|
||||
- name: Ensure correct permissions (hosts/resolv.conf)
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
path: "{{ perm_config }}"
|
||||
state: touch
|
||||
mode: u+rw,g+r,a+r
|
||||
with_items:
|
||||
- /etc/resolv.conf
|
||||
- /etc/hosts
|
||||
loop_control:
|
||||
loop_var: perm_config
|
||||
changed_when: false
|
||||
tags: dns
|
||||
|
||||
Reference in New Issue
Block a user