Initial import

This commit is contained in:
Frank Agerholm 2024-03-07 22:38:24 +01:00
commit c28551bb63
No known key found for this signature in database
22 changed files with 357 additions and 0 deletions

14
os_update_etc_hosts.yml Normal file
View 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 }}"