From 4557292743497716a44692d26ffd483c5501518c Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Tue, 26 Mar 2019 14:22:26 +0100
Subject: [PATCH] ipa[server,replica,client]: Do not try to execute tasks after
 the role test

The role test is executed in the ipa[server,replica,client] roles first.
These tests are usable in the Ansible test mode, but the folllowing steps
in the task list are not. Therefore the blocks following the tests are
limited to not being executed in test mode.
---
 roles/ipaclient/tasks/install.yml  | 2 ++
 roles/ipareplica/tasks/install.yml | 2 ++
 roles/ipaserver/tasks/install.yml  | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml
index 66269225..918647f8 100644
--- a/roles/ipaclient/tasks/install.yml
+++ b/roles/ipaclient/tasks/install.yml
@@ -295,6 +295,8 @@
       nisdomain: "{{ ipaclient_nisdomain | default(omit)}}"
     when: not ipaclient_no_nisdomain | bool
 
+  when: not ansible_check_mode
+
   always:
   - name: Cleanup leftover ccache
     file:
diff --git a/roles/ipareplica/tasks/install.yml b/roles/ipareplica/tasks/install.yml
index a6309561..4c5b86b0 100644
--- a/roles/ipareplica/tasks/install.yml
+++ b/roles/ipareplica/tasks/install.yml
@@ -622,3 +622,5 @@
       path: "/root/.ipa_cache"
       state: absent
     when: result_ipareplica_enable_ipa.changed
+
+  when: not ansible_check_mode
diff --git a/roles/ipaserver/tasks/install.yml b/roles/ipaserver/tasks/install.yml
index 7808dd46..f2b3d167 100644
--- a/roles/ipaserver/tasks/install.yml
+++ b/roles/ipaserver/tasks/install.yml
@@ -388,3 +388,5 @@
       {{ "--add-service=dns" if ipaserver_setup_dns | bool else "" }}
       {{ "--add-service=ntp" if not ipaclient_no_ntp | bool else "" }}
     when: ipaserver_setup_firewalld | bool
+
+  when: not ansible_check_mode
-- 
GitLab