set hostname during update_hosts.yml playbook

This commit is contained in:
2022-08-21 09:57:50 -04:00
parent 42c80b4894
commit bcbca14816
7 changed files with 82 additions and 43 deletions

View File

@@ -0,0 +1,14 @@
---
#Try and setup correct hostnames
- name: Set hostname to {{inventory_hostname}}
ansible.builtin.hostname:
name: "{{inventory_hostname}}"
- name: Template a file to /etc/file.conf
ansible.builtin.template:
src: hosts.j2
dest: /etc/hosts
owner: root
group: root
mode: '0644'