Update..
This commit is contained in:
@ -70,3 +70,32 @@
|
||||
tags:
|
||||
- limits-conf
|
||||
|
||||
# - /etc/hosts
|
||||
|
||||
- name: (basic.yml) Check file '/etc/hosts.ORIG' exists
|
||||
stat:
|
||||
path: /etc/hosts.ORIG
|
||||
register: etc_hosts_ORIG
|
||||
when:
|
||||
- "groups['file_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- etc_hosts
|
||||
|
||||
- name: (basic.yml) Backup installation version of file '/etc/hosts'
|
||||
command: cp -a /etc/hosts /etc/hosts.ORIG
|
||||
when:
|
||||
- "groups['file_server']|string is search(inventory_hostname)"
|
||||
- etc_hosts_ORIG.stat.exists == False
|
||||
tags:
|
||||
- etc_hosts
|
||||
|
||||
- name: (basic.yml) addjust '/etc/hosts' add nis-server ..
|
||||
lineinfile:
|
||||
path: /etc/hosts
|
||||
regexp: '^192\.168\.82\.'
|
||||
line: '{{ nis_server_address }} {{ nis_server_name }} {{ nis_server_name.split(".")[0] }}'
|
||||
when:
|
||||
- "groups['nis_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- etc_hosts
|
||||
|
||||
|
Reference in New Issue
Block a user