diff --git a/hosts.yml b/hosts.yml new file mode 100644 index 0000000..cdd74df --- /dev/null +++ b/hosts.yml @@ -0,0 +1,9 @@ +--- +- name: build hosts file + lineinfile: + dest: /etc/hosts + insertafter: EOF + line: '{{ item }}' + state: present + with_items: + - '{{ ansible_default_ipv4.address }} {{ ansible_hostname }} {{ ansible_fqdn }}' \ No newline at end of file diff --git a/main.yml b/main.yml index 02c9aaf..f1e07b6 100644 --- a/main.yml +++ b/main.yml @@ -4,7 +4,7 @@ tasks: - include_tasks: assert-vars.yml # - include_tasks: disable_ipv6.yml -# - include_tasks: hosts.yml + - include_tasks: hosts.yml # - include_tasks: inst_packages.yml # - include_tasks: misc.yml \ No newline at end of file