From 7cf80c59b8549ed0016755bc866932df478bdb90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jes=C3=BAs?= <jesmg@users.noreply.github.com>
Date: Thu, 23 Jan 2020 18:09:10 +0100
Subject: [PATCH] Not delete keytab when ipaclient_on_master is true

Keep the valid keytab file pre-existent in the master node. This fixes #191.
---
 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 acb96e00..0de3dea8 100644
--- a/roles/ipaclient/tasks/install.yml
+++ b/roles/ipaclient/tasks/install.yml
@@ -191,7 +191,7 @@
     #   5 - Principal name or realm not found in keytab
     failed_when: result_ipa_rmkeytab.rc != 0 and
                  result_ipa_rmkeytab.rc != 3 and result_ipa_rmkeytab.rc != 5
-    when: ipaclient_use_otp | bool or ipaclient_force_join | bool
+    when: (ipaclient_use_otp | bool or ipaclient_force_join | bool) and not ipaclient_on_master | bool
 
   - name: Install - Backup and set hostname
     ipaclient_set_hostname:
-- 
GitLab