From 438f09bad977e6c42d98b70f3737101098aacbfa Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Mon, 17 Jun 2019 16:40:14 +0200
Subject: [PATCH] ipareplica: The dm password is not needed for
 ipareplica_master_password

The module ipareplica_master_password has been a copy from ipaserver role
and still contained code to read the cache file. This is not needed for
the replica. Therefore there is no need also to provide the dm password
to ipareplica_master_password any more.
---
 .../ipareplica/library/ipareplica_master_password.py  | 11 -----------
 roles/ipareplica/tasks/install.yml                    |  1 -
 2 files changed, 12 deletions(-)

diff --git a/roles/ipareplica/library/ipareplica_master_password.py b/roles/ipareplica/library/ipareplica_master_password.py
index 77f6f8ec..d458e66a 100644
--- a/roles/ipareplica/library/ipareplica_master_password.py
+++ b/roles/ipareplica/library/ipareplica_master_password.py
@@ -60,7 +60,6 @@ def main():
     module = AnsibleModule(
         argument_spec = dict(
             #basic
-            dm_password=dict(required=True, no_log=True),
             master_password=dict(required=False, no_log=True),
         ),
         supports_check_mode = True,
@@ -68,21 +67,11 @@ def main():
 
     module._ansible_debug = True
 
-    options.dm_password = module.params.get('dm_password')
     options.master_password = module.params.get('master_password')
 
     fstore = sysrestore.FileStore(paths.SYSRESTORE)
     sstore = sysrestore.StateFile(paths.SYSRESTORE)
 
-    # This will override any settings passed in on the cmdline
-    if os.path.isfile(paths.ROOT_IPA_CACHE):
-        # dm_password check removed, checked already
-        try:
-            cache_vars = read_cache(options.dm_password)
-            options.__dict__.update(cache_vars)
-        except Exception as e:
-            module.fail_json(msg="Cannot process the cache file: %s" % str(e))
-
     if not options.master_password:
         options.master_password = ipa_generate_password()
 
diff --git a/roles/ipareplica/tasks/install.yml b/roles/ipareplica/tasks/install.yml
index 9acf558f..7c0a198f 100644
--- a/roles/ipareplica/tasks/install.yml
+++ b/roles/ipareplica/tasks/install.yml
@@ -178,7 +178,6 @@
   - name: Install - Create dirman password
     no_log: yes
     ipareplica_master_password:
-      dm_password: "{{ ipadm_password }}"
       master_password: "{{ ipareplica_master_password | default(omit) }}"
     register: result_ipareplica_master_password
 
-- 
GitLab