Configure /etc/hosts on pure xen only.

This commit is contained in:
Andrea Dell'Amico 2018-09-05 17:02:03 +02:00
parent cfb54c3123
commit 5398dfe38d
1 changed files with 3 additions and 1 deletions

View File

@ -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' ]