mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 22:03:18 +00:00
ipareplica_setup_adtrust: Fix setup_ca, master_host_name and ldap2 backend connection
The parameter config_setup_ca has been renamed to setup_ca and added to options. master_host_name has been added to config. Also a call for api.Backend.ldap2.connect has been added to make sure that the backend is connected.
This commit is contained in:
@@ -52,7 +52,7 @@ options:
|
||||
_top_dir:
|
||||
description:
|
||||
required: yes
|
||||
config_setup_ca:
|
||||
setup_ca:
|
||||
description:
|
||||
required: yes
|
||||
config_master_host_name:
|
||||
@@ -82,7 +82,7 @@ def main():
|
||||
### additional ###
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
config_setup_ca=dict(required=True),
|
||||
setup_ca=dict(required=True),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
@@ -105,7 +105,7 @@ def main():
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
config_setup_ca = ansible_module.params.get('config_setup_ca')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
|
||||
# init #
|
||||
@@ -115,7 +115,6 @@ def main():
|
||||
|
||||
ansible_log.debug("== INSTALL ==")
|
||||
|
||||
options = installer
|
||||
promote = installer.promote
|
||||
|
||||
env = gen_env_boostrap_finalize_core(paths.ETC_IPA,
|
||||
@@ -123,13 +122,16 @@ def main():
|
||||
api_bootstrap_finalize(env)
|
||||
config = gen_ReplicaConfig()
|
||||
config.subject_base = options.subject_base
|
||||
config.master_host_name = config_master_host_name
|
||||
|
||||
remote_api = gen_remote_api(master_host_name, paths.ETC_IPA)
|
||||
remote_api = gen_remote_api(config.master_host_name, paths.ETC_IPA)
|
||||
installer._remote_api = remote_api
|
||||
|
||||
conn = remote_api.Backend.ldap2
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
|
||||
api.Backend.ldap2.connect()
|
||||
|
||||
with redirect_stdout(ansible_log):
|
||||
#if options.setup_adtrust:
|
||||
ansible_log.debug("-- INSTALL ADTRUST --")
|
||||
|
||||
@@ -595,7 +595,7 @@
|
||||
### additional ###
|
||||
ccache: "{{ result_ipareplica_prepare.ccache }}"
|
||||
_top_dir: "{{ result_ipareplica_prepare._top_dir }}"
|
||||
config_setup_ca: "{{ result_ipareplica_prepare.config_setup_ca }}"
|
||||
setup_ca: "{{ result_ipareplica_prepare.config_setup_ca }}"
|
||||
config_master_host_name: "{{ result_ipareplica_prepare.config_master_host_name }}"
|
||||
when: result_ipareplica_test.setup_adtrust
|
||||
|
||||
|
||||
Reference in New Issue
Block a user