From e955566e168efdee5121e8e535601cb0223def9f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 12 Sep 2017 15:33:56 +0200 Subject: [PATCH] Set the provided hostname when it's defined. --- deb-set-hostname/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb-set-hostname/tasks/main.yml b/deb-set-hostname/tasks/main.yml index 90a1d142..7eb5c883 100644 --- a/deb-set-hostname/tasks/main.yml +++ b/deb-set-hostname/tasks/main.yml @@ -5,6 +5,6 @@ tags: bootstrap - name: Add the hostname to /etc/hosts - shell: grep -v {{ ansible_default_ipv4.address }} /etc/hosts > /etc/hosts.tmp ; echo "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" >> /etc/hosts.tmp ; /bin/mv /etc/hosts.tmp /etc/hosts + shell: grep -v {{ ansible_default_ipv4.address }} /etc/hosts > /etc/hosts.tmp ; echo "{{ ansible_default_ipv4.address }} {{ hostname }} {{ ansible_hostname }}" >> /etc/hosts.tmp ; /bin/mv /etc/hosts.tmp /etc/hosts when: hostname is defined tags: bootstrap