From 5398dfe38d32b417bfbd08c9e55a2e859f3b23d9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 5 Sep 2018 17:02:03 +0200 Subject: [PATCH] Configure /etc/hosts on pure xen only. --- deb-set-hostname/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deb-set-hostname/tasks/main.yml b/deb-set-hostname/tasks/main.yml index 89f3daef..7f7aae65 100644 --- a/deb-set-hostname/tasks/main.yml +++ b/deb-set-hostname/tasks/main.yml @@ -6,5 +6,7 @@ - name: Add the hostname to /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 + when: + - hostname is defined + - ansible_virtualization_type == 'xen' tags: [ 'bootstrap', 'set_hostname' ]