From 86323feb8026017b911a9f807f8502aa7a0deea6 Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Thu, 9 Nov 2017 13:20:44 +0100
Subject: [PATCH] roles/ipaclient/tasks/install.yml: Allow to specify different
 hostname

ipaclient_hostname needs to be specified in the inventory file for the hosts
where the name needs to get changed.

Example:
192.168.1.1 ipaclient_hostname=ipaclient1.mine.local

The option should not be specified in [ipaclients:vars] as all hosts would
get the same name.
---
 roles/ipaclient/tasks/install.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml
index b5c214b7..fbf03f34 100644
--- a/roles/ipaclient/tasks/install.yml
+++ b/roles/ipaclient/tasks/install.yml
@@ -16,7 +16,7 @@
     domain: "{{ ipaclient_domain | default(omit) }}"
     servers: "{{ groups.ipaservers | default(omit) }}"
     realm: "{{ ipaclient_realm | default(omit) }}"
-    hostname: "{{ ansible_fqdn }}"
+    hostname: "{{ ipaclient_hostname | default(ansible_fqdn) }}"
     #ca_cert_file: "{{ ipaclient_ca_cert_file | default(omit) }}"
     check: yes
   register: ipadiscovery
-- 
GitLab