From 4901230c998069b71ac4053557d9770b5288f7d5 Mon Sep 17 00:00:00 2001 From: Adham Helal Date: Tue, 10 Feb 2015 19:49:20 +0100 Subject: [PATCH] Temp override of ansible_hostname Some name fix --- tasks/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 027c299..a80c1d0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Set hostname FQDN variable +- name: Temp override for "hostname_fqdn" set_fact: hostname_fqdn : "{{ inventory_hostname }}" when: hostname_fqdn is not defined @@ -16,7 +16,12 @@ - name: Set machine hostname hostname: - name: "{{hostname_short}}" + name: "{{ hostname_short }}" + +- name: Temp override facts "hostname_short" + set_fact: + ansible_hostname : "{{ hostname_short }}" + when: ansible_hostname != hostname_short - name: Ensure hostname is in /etc/hostname copy: