diff --git a/tasks/config.yml b/tasks/config.yml index cad1b36..44233a3 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,13 +1,9 @@ --- - block: - name: Set hostname - template: - src: etc/hostname.j2 - dest: /etc/hostname - owner: root - group: root - mode: 0644 - register: hostname_result + hostname: + name: "{{ network_hostname }}" + when: network_hostname notify: __host_reboot - name: Set hosts file @@ -17,7 +13,6 @@ owner: root group: root mode: 0644 - register: hosts_result notify: __host_reboot - name: Add network interface configuration diff --git a/templates/etc/hostname.j2 b/templates/etc/hostname.j2 deleted file mode 100644 index 1f6315b..0000000 --- a/templates/etc/hostname.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% if network_hostname is defined %} -{{ network_hostname }} -{% endif %}