Initial import
This commit is contained in:
commit
c28551bb63
22 changed files with 357 additions and 0 deletions
14
os_update_etc_hosts.yml
Normal file
14
os_update_etc_hosts.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
- name: Static DNS Lookup
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
become: true
|
||||
tasks:
|
||||
- name: Add all hosts to /etc/hosts
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "^{{ hostvars[item]['ansible_facts']['default_ipv4']['address'] }}.+{{ hostvars[item].ansible_facts.fqdn }}.*$"
|
||||
line: "{{ hostvars[item]['ansible_facts']['default_ipv4']['address'] }} {{ hostvars[item].ansible_facts.fqdn }} {{ hostvars[item].ansible_facts.hostname }}"
|
||||
state: present
|
||||
with_items: "{{ groups.all }}"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue