mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 05:22:05 +00:00
ipa[server,replica,client]: flake8 and pylint fixes
These are white space and line length changes to calm down pylint and flake8.
This commit is contained in:
@@ -78,16 +78,16 @@ if six.PY3:
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_kra=dict(required=True, type='bool'),
|
||||
### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
installer_ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -96,14 +96,15 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
### additional ###
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
# additional
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._ccache = ansible_module.params.get('installer_ccache')
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
|
||||
# init #
|
||||
@@ -115,10 +116,10 @@ def main():
|
||||
env = gen_env_boostrap_finalize_core(paths.ETC_IPA,
|
||||
constants.DEFAULT_CONFIG)
|
||||
api_bootstrap_finalize(env)
|
||||
#config = gen_ReplicaConfig()
|
||||
# config = gen_ReplicaConfig()
|
||||
|
||||
remote_api = gen_remote_api(config_master_host_name, paths.ETC_IPA)
|
||||
#installer._remote_api = remote_api
|
||||
# installer._remote_api = remote_api
|
||||
|
||||
conn = remote_api.Backend.ldap2
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
@@ -141,5 +142,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -141,10 +141,11 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, create_ipa_conf
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
dm_password=dict(required=False, no_log=True),
|
||||
password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
@@ -153,33 +154,33 @@ def main():
|
||||
hostname=dict(required=False),
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
no_host_dns=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool'),
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
### client ###
|
||||
# client
|
||||
force_join=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
config_master_host_name=dict(required=True),
|
||||
config_ca_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
installer_ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_top_dir = dict(required=True),
|
||||
_add_to_ipaservers = dict(required=True, type='bool'),
|
||||
_top_dir=dict(required=True),
|
||||
_add_to_ipaservers=dict(required=True, type='bool'),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
master=dict(required=False, default=None),
|
||||
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -198,16 +199,16 @@ def main():
|
||||
options.host_name = ansible_module.params.get('hostname')
|
||||
options.ca_cert_files = ansible_module.params.get('ca_cert_files')
|
||||
options.no_host_dns = ansible_module.params.get('no_host_dns')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
### client ###
|
||||
# client
|
||||
options.force_join = ansible_module.params.get('force_join')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.external_ca = ansible_module.params.get('external_ca')
|
||||
options.external_cert_files = ansible_module.params.get(
|
||||
'external_cert_files')
|
||||
@@ -215,15 +216,15 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
### additional ###
|
||||
#options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
# additional
|
||||
# options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
options.server = ansible_module.params.get('server')
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ca_host_name = ansible_module.params.get('config_ca_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
|
||||
@@ -231,7 +232,8 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options._add_to_ipaservers = ansible_module.params.get('_add_to_ipaservers')
|
||||
options._add_to_ipaservers = ansible_module.params.get(
|
||||
'_add_to_ipaservers')
|
||||
|
||||
options._ca_subject = ansible_module.params.get('_ca_subject')
|
||||
options._subject_base = ansible_module.params.get('_subject_base')
|
||||
@@ -277,5 +279,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -96,29 +96,30 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, custodiainstance
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_kra_enabled=dict(required=False, type='bool'),
|
||||
_kra_host_name=dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
config_setup_ca=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
config_ca_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -127,20 +128,20 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
kra_enabled = ansible_module.params.get('_kra_enabled')
|
||||
kra_host_name = ansible_module.params.get('_kra_host_name')
|
||||
@@ -198,5 +199,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -50,36 +50,37 @@ RETURN = '''
|
||||
import os
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, installer, DN, paths,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, gen_remote_api, api, redirect_stdout,
|
||||
replica_ds_init_info, dsinstance, upgradeinstance, installutils
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
dirsrv_config_file=dict(required=False),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_dirsrv_pkcs12_info = dict(required=False),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_dirsrv_pkcs12_info=dict(required=False),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
ds_ca_subject=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -88,24 +89,27 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
options.dirsrv_config_file = ansible_module.params.get('dirsrv_config_file')
|
||||
### certificate system ###
|
||||
options.dirsrv_config_file = ansible_module.params.get(
|
||||
'dirsrv_config_file')
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
installer._dirsrv_pkcs12_info = ansible_module.params.get('_dirsrv_pkcs12_info')
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
installer._dirsrv_pkcs12_info = ansible_module.params.get(
|
||||
'_dirsrv_pkcs12_info')
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
ds_ca_subject = ansible_module.params.get('ds_ca_subject')
|
||||
@@ -146,8 +150,8 @@ def main():
|
||||
|
||||
# Apply any LDAP updates. Needs to be done after the replica is
|
||||
# synced-up
|
||||
#service.print_msg("Applying LDAP updates")
|
||||
#ds.apply_updates()
|
||||
# service.print_msg("Applying LDAP updates")
|
||||
# ds.apply_updates()
|
||||
schema_files = dsinstance.get_all_external_schema_files(
|
||||
paths.EXTERNAL_SCHEMA_DIR)
|
||||
data_upgrade = upgradeinstance.IPAUpgrade(ds.realm,
|
||||
@@ -164,5 +168,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -96,28 +96,29 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
replica_ds_init_info
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
dirsrv_config_file=dict(required=False),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_dirsrv_pkcs12_info = dict(required=False),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_dirsrv_pkcs12_info=dict(required=False),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
ds_ca_subject=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -126,24 +127,27 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
options.dirsrv_config_file = ansible_module.params.get('dirsrv_config_file')
|
||||
### certificate system ###
|
||||
options.dirsrv_config_file = ansible_module.params.get(
|
||||
'dirsrv_config_file')
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
options._dirsrv_pkcs12_info = ansible_module.params.get('_dirsrv_pkcs12_info')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
options._dirsrv_pkcs12_info = ansible_module.params.get(
|
||||
'_dirsrv_pkcs12_info')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
ds_ca_subject = ansible_module.params.get('ds_ca_subject')
|
||||
@@ -163,7 +167,7 @@ def main():
|
||||
config.subject_base = options.subject_base
|
||||
|
||||
remote_api = gen_remote_api(master_host_name, paths.ETC_IPA)
|
||||
#installer._remote_api = remote_api
|
||||
# installer._remote_api = remote_api
|
||||
|
||||
conn = remote_api.Backend.ldap2
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
@@ -190,5 +194,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -75,22 +75,23 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
find_providing_servers, services
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
argument_spec=dict(
|
||||
hostname=dict(required=False),
|
||||
hidden_replica=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
### certificate system ###
|
||||
# server
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
setup_ca=dict(required=True, type='bool'),
|
||||
setup_kra=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -101,18 +102,19 @@ def main():
|
||||
options = installer
|
||||
options.host_name = ansible_module.params.get('hostname')
|
||||
options.hidden_replica = ansible_module.params.get('hidden_replica')
|
||||
### server ###
|
||||
### certificate system ###
|
||||
# server
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
|
||||
# init #
|
||||
|
||||
@@ -159,5 +161,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -109,10 +109,11 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
install_ca_cert
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
dm_password=dict(required=False, no_log=True),
|
||||
password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
@@ -121,23 +122,23 @@ def main():
|
||||
hostname=dict(required=False),
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
no_host_dns=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool'),
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
### client ###
|
||||
# client
|
||||
force_join=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
installer_ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_add_to_ipaservers = dict(required=True, type='bool'),
|
||||
_top_dir=dict(required=True),
|
||||
_add_to_ipaservers=dict(required=True, type='bool'),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
@@ -146,7 +147,7 @@ def main():
|
||||
config_ca_host_name=dict(required=True),
|
||||
config_ips=dict(required=False, type='list', default=[]),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -155,7 +156,7 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### basic ###
|
||||
# basic
|
||||
options.dm_password = ansible_module.params.get('dm_password')
|
||||
options.password = options.dm_password
|
||||
options.admin_password = ansible_module.params.get('password')
|
||||
@@ -166,16 +167,16 @@ def main():
|
||||
options.host_name = ansible_module.params.get('hostname')
|
||||
options.ca_cert_files = ansible_module.params.get('ca_cert_files')
|
||||
options.no_host_dns = ansible_module.params.get('no_host_dns')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
### client ###
|
||||
# client
|
||||
options.force_join = ansible_module.params.get('force_join')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.external_ca = ansible_module.params.get('external_ca')
|
||||
options.external_cert_files = ansible_module.params.get(
|
||||
'external_cert_files')
|
||||
@@ -183,22 +184,24 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
### additional ###
|
||||
# additional
|
||||
options.server = ansible_module.params.get('server')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options._add_to_ipaservers = ansible_module.params.get('_add_to_ipaservers')
|
||||
options._add_to_ipaservers = ansible_module.params.get(
|
||||
'_add_to_ipaservers')
|
||||
options._ca_subject = ansible_module.params.get('_ca_subject')
|
||||
options._subject_base = ansible_module.params.get('_subject_base')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
config_setup_ca = ansible_module.params.get('config_setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
config_ca_host_name = ansible_module.params.get('config_ca_host_name')
|
||||
config_ips = ansible_module_get_parsed_ip_addresses(ansible_module,
|
||||
"config_ips")
|
||||
@@ -242,7 +245,8 @@ def main():
|
||||
|
||||
ansible_log.debug("-- INSTALL_CA_CERT --")
|
||||
# Update and istall updated CA file
|
||||
cafile = install_ca_cert(conn, api.env.basedn, api.env.realm, cafile)
|
||||
cafile = install_ca_cert(conn, api.env.basedn, api.env.realm,
|
||||
cafile)
|
||||
install_ca_cert(conn, api.env.basedn, api.env.realm, cafile,
|
||||
destfile=paths.KDC_CA_BUNDLE_PEM)
|
||||
install_ca_cert(conn, api.env.basedn, api.env.realm, cafile,
|
||||
@@ -259,5 +263,6 @@ def main():
|
||||
config_master_host_name=config.master_host_name,
|
||||
config_ca_host_name=config.ca_host_name)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -56,25 +56,26 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, api, krbinstance, redirect_stdout
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -83,21 +84,22 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
|
||||
@@ -116,7 +118,7 @@ def main():
|
||||
config.dirman_password = dirman_password
|
||||
|
||||
remote_api = gen_remote_api(master_host_name, paths.ETC_IPA)
|
||||
#installer._remote_api = remote_api
|
||||
# installer._remote_api = remote_api
|
||||
|
||||
conn = remote_api.Backend.ldap2
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
@@ -145,5 +147,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -56,13 +56,14 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
ipa_generate_password
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#basic
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
master_password=dict(required=False, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module._ansible_debug = True
|
||||
@@ -75,5 +76,6 @@ def main():
|
||||
module.exit_json(changed=True,
|
||||
password=master_password)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -157,8 +157,8 @@ if six.PY3:
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
dm_password=dict(required=False, no_log=True),
|
||||
password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
@@ -168,12 +168,12 @@ def main():
|
||||
principal=dict(required=True),
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
no_host_dns=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool'),
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
dirsrv_cert_name=dict(required=False),
|
||||
dirsrv_pin=dict(required=False),
|
||||
@@ -183,7 +183,7 @@ def main():
|
||||
pkinit_cert_files=dict(required=False, type='list', default=[]),
|
||||
pkinit_cert_name=dict(required=False),
|
||||
pkinit_pin=dict(required=False),
|
||||
### client ###
|
||||
# client
|
||||
keytab=dict(required=False),
|
||||
mkhomedir=dict(required=False, type='bool'),
|
||||
force_join=dict(required=False, type='bool'),
|
||||
@@ -192,11 +192,12 @@ def main():
|
||||
no_ssh=dict(required=False, type='bool'),
|
||||
no_sshd=dict(required=False, type='bool'),
|
||||
no_dns_sshfp=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
#subject_base=dict(required=False),
|
||||
### dns ###
|
||||
allow_zone_overlap=dict(required=False, type='bool', default=False),
|
||||
reverse_zones=dict(required=False,type='list',default=[]),
|
||||
# certificate system
|
||||
# subject_base=dict(required=False),
|
||||
# dns
|
||||
allow_zone_overlap=dict(required=False, type='bool',
|
||||
default=False),
|
||||
reverse_zones=dict(required=False, type='list', default=[]),
|
||||
no_reverse=dict(required=False, type='bool', default=False),
|
||||
auto_reverse=dict(required=False, type='bool', default=False),
|
||||
forwarders=dict(required=False, type='list', default=[]),
|
||||
@@ -205,17 +206,17 @@ def main():
|
||||
forward_policy=dict(default=None, choices=['first', 'only']),
|
||||
no_dnssec_validation=dict(required=False, type='bool',
|
||||
default=False),
|
||||
### ad trust ###
|
||||
# ad trust
|
||||
enable_compat=dict(required=False, type='bool', default=False),
|
||||
netbios_name=dict(required=False),
|
||||
rid_base=dict(required=False, type='int', default=1000),
|
||||
secondary_rid_base=dict(required=False, type='int',
|
||||
default=100000000),
|
||||
### additional ###
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
skip_conncheck=dict(required=False, type='bool'),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -234,12 +235,12 @@ def main():
|
||||
options.principal = ansible_module.params.get('principal')
|
||||
options.ca_cert_files = ansible_module.params.get('ca_cert_files')
|
||||
options.no_host_dns = ansible_module.params.get('no_host_dns')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
options.dirsrv_cert_name = ansible_module.params.get('dirsrv_cert_name')
|
||||
options.dirsrv_pin = ansible_module.params.get('dirsrv_pin')
|
||||
@@ -249,7 +250,7 @@ def main():
|
||||
options.pkinit_cert_files = ansible_module.params.get('pkinit_cert_files')
|
||||
options.pkinit_cert_name = ansible_module.params.get('pkinit_cert_name')
|
||||
options.pkinit_pin = ansible_module.params.get('pkinit_pin')
|
||||
### client ###
|
||||
# client
|
||||
options.keytab = ansible_module.params.get('keytab')
|
||||
options.mkhomedir = ansible_module.params.get('mkhomedir')
|
||||
options.force_join = ansible_module.params.get('force_join')
|
||||
@@ -258,15 +259,17 @@ def main():
|
||||
options.no_ssh = ansible_module.params.get('no_ssh')
|
||||
options.no_sshd = ansible_module.params.get('no_sshd')
|
||||
options.no_dns_sshfp = ansible_module.params.get('no_dns_sshfp')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.external_ca = ansible_module.params.get('external_ca')
|
||||
options.external_cert_files = ansible_module.params.get(
|
||||
'external_cert_files')
|
||||
#options.subject_base = ansible_module.params.get('subject_base')
|
||||
#options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
options.no_dnssec_validation = ansible_module.params.get('no_dnssec_validation')
|
||||
### dns ###
|
||||
options.allow_zone_overlap = ansible_module.params.get('allow_zone_overlap')
|
||||
# options.subject_base = ansible_module.params.get('subject_base')
|
||||
# options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
options.no_dnssec_validation = ansible_module.params.get(
|
||||
'no_dnssec_validation')
|
||||
# dns
|
||||
options.allow_zone_overlap = ansible_module.params.get(
|
||||
'allow_zone_overlap')
|
||||
options.reverse_zones = ansible_module.params.get('reverse_zones')
|
||||
options.no_reverse = ansible_module.params.get('no_reverse')
|
||||
options.auto_reverse = ansible_module.params.get('auto_reverse')
|
||||
@@ -276,15 +279,16 @@ def main():
|
||||
options.forward_policy = ansible_module.params.get('forward_policy')
|
||||
options.no_dnssec_validation = ansible_module.params.get(
|
||||
'no_dnssec_validationdnssec_validation')
|
||||
### ad trust ###
|
||||
# ad trust
|
||||
options.enable_compat = ansible_module.params.get('enable_compat')
|
||||
options.netbios_name = ansible_module.params.get('netbios_name')
|
||||
options.rid_base = ansible_module.params.get('rid_base')
|
||||
options.secondary_rid_base = ansible_module.params.get('secondary_rid_base')
|
||||
options.secondary_rid_base = ansible_module.params.get(
|
||||
'secondary_rid_base')
|
||||
|
||||
### additional ###
|
||||
#options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
# additional
|
||||
# options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
options.server = ansible_module.params.get('server')
|
||||
options.skip_conncheck = ansible_module.params.get('skip_conncheck')
|
||||
|
||||
@@ -301,15 +305,15 @@ def main():
|
||||
|
||||
ansible_log.debug("== PROMOTE CHECK ==")
|
||||
|
||||
#ansible_log.debug("-- NO_NTP --") # already done in test
|
||||
# ansible_log.debug("-- NO_NTP --") # already done in test
|
||||
|
||||
## check selinux status, http and DS ports, NTP conflicting services
|
||||
#common_check(options.no_ntp)
|
||||
# check selinux status, http and DS ports, NTP conflicting services
|
||||
# common_check(options.no_ntp)
|
||||
|
||||
installer._enrollment_performed = False
|
||||
installer._top_dir = tempfile.mkdtemp("ipa")
|
||||
|
||||
#with ipautil.private_ccache():
|
||||
# with ipautil.private_ccache():
|
||||
dir_path = tempfile.mkdtemp(prefix='krbcc')
|
||||
os.environ['KRB5CCNAME'] = os.path.join(dir_path, 'ccache')
|
||||
|
||||
@@ -352,7 +356,7 @@ def main():
|
||||
config.setup_kra = options.setup_kra
|
||||
config.dir = installer._top_dir
|
||||
config.basedn = api.env.basedn
|
||||
#config.hidden_replica = options.hidden_replica
|
||||
# config.hidden_replica = options.hidden_replica
|
||||
|
||||
# load and check certificates #
|
||||
|
||||
@@ -371,8 +375,8 @@ def main():
|
||||
if options.http_cert_files:
|
||||
ansible_log.debug("-- HTTP_CERT_FILES --")
|
||||
if options.http_pin is None:
|
||||
ansible_module.fail_json(msg=
|
||||
"Apache Server private key unlock password required")
|
||||
ansible_module.fail_json(
|
||||
msg="Apache Server private key unlock password required")
|
||||
http_pkcs12_file, http_pin, http_ca_cert = load_pkcs12(
|
||||
cert_files=options.http_cert_files,
|
||||
key_password=options.http_pin,
|
||||
@@ -384,8 +388,8 @@ def main():
|
||||
if options.dirsrv_cert_files:
|
||||
ansible_log.debug("-- DIRSRV_CERT_FILES --")
|
||||
if options.dirsrv_pin is None:
|
||||
ansible_module.fail_json(msg=
|
||||
"Directory Server private key unlock password required")
|
||||
ansible_module.fail_json(
|
||||
msg="Directory Server private key unlock password required")
|
||||
dirsrv_pkcs12_file, dirsrv_pin, dirsrv_ca_cert = load_pkcs12(
|
||||
cert_files=options.dirsrv_cert_files,
|
||||
key_password=options.dirsrv_pin,
|
||||
@@ -397,8 +401,8 @@ def main():
|
||||
if options.pkinit_cert_files:
|
||||
ansible_log.debug("-- PKINIT_CERT_FILES --")
|
||||
if options.pkinit_pin is None:
|
||||
ansible_module.fail_json(msg=
|
||||
"Kerberos KDC private key unlock password required")
|
||||
ansible_module.fail_json(
|
||||
msg="Kerberos KDC private key unlock password required")
|
||||
pkinit_pkcs12_file, pkinit_pin, pkinit_ca_cert = load_pkcs12(
|
||||
cert_files=options.pkinit_cert_files,
|
||||
key_password=options.pkinit_pin,
|
||||
@@ -483,8 +487,8 @@ def main():
|
||||
check_domain_level_is_supported(domain_level)
|
||||
if domain_level < constants.MIN_DOMAIN_LEVEL:
|
||||
ansible_module.fail_json(
|
||||
msg=
|
||||
"Cannot promote this client to a replica. The domain level "
|
||||
msg="Cannot promote this client to a replica. The domain "
|
||||
"level "
|
||||
"must be raised to {mindomainlevel} before the replica can be "
|
||||
"installed".format(
|
||||
mindomainlevel=constants.MIN_DOMAIN_LEVEL))
|
||||
@@ -641,8 +645,10 @@ def main():
|
||||
options.host_name = config.host_name
|
||||
ca.install_check(False, config, options)
|
||||
|
||||
ansible_log.debug(" ca.external_cert_file=%s" % repr(ca.external_cert_file))
|
||||
ansible_log.debug(" ca.external_ca_file=%s" % repr(ca.external_ca_file))
|
||||
ansible_log.debug(" ca.external_cert_file=%s" %
|
||||
repr(ca.external_cert_file))
|
||||
ansible_log.debug(" ca.external_ca_file=%s" %
|
||||
repr(ca.external_ca_file))
|
||||
|
||||
# TODO
|
||||
# TODO
|
||||
@@ -681,11 +687,11 @@ def main():
|
||||
except errors.ACIError:
|
||||
logger.debug("%s", traceback.format_exc())
|
||||
ansible_module.fail_json(
|
||||
msg = ("\nInsufficient privileges to promote the server."
|
||||
"\nPossible issues:"
|
||||
"\n- A user has insufficient privileges"
|
||||
"\n- This client has insufficient privileges "
|
||||
"to become an IPA replica"))
|
||||
msg=("\nInsufficient privileges to promote the server."
|
||||
"\nPossible issues:"
|
||||
"\n- A user has insufficient privileges"
|
||||
"\n- This client has insufficient privileges "
|
||||
"to become an IPA replica"))
|
||||
except errors.LDAPError:
|
||||
logger.debug("%s", traceback.format_exc())
|
||||
ansible_module.fail_json(msg="\nUnable to connect to LDAP server %s" %
|
||||
@@ -738,41 +744,42 @@ def main():
|
||||
|
||||
# done #
|
||||
|
||||
ansible_module.exit_json(changed=True,
|
||||
ccache=ccache,
|
||||
installer_ccache=installer._ccache,
|
||||
subject_base=str(config.subject_base),
|
||||
forward_policy=options.forward_policy,
|
||||
_ca_enabled=ca_enabled,
|
||||
_ca_subject=str(options._ca_subject),
|
||||
_subject_base=str(options._subject_base) if options._subject_base is not None else None,
|
||||
_kra_enabled=kra_enabled,
|
||||
_ca_file=cafile,
|
||||
_top_dir=installer._top_dir,
|
||||
_add_to_ipaservers=add_to_ipaservers,
|
||||
_dirsrv_pkcs12_file=dirsrv_pkcs12_file,
|
||||
_dirsrv_pkcs12_info=dirsrv_pkcs12_info,
|
||||
_dirsrv_ca_cert=dirsrv_ca_cert,
|
||||
_http_pkcs12_file=http_pkcs12_file,
|
||||
_http_pkcs12_info=http_pkcs12_info,
|
||||
_http_ca_cert=http_ca_cert,
|
||||
_pkinit_pkcs12_file=pkinit_pkcs12_file,
|
||||
_pkinit_pkcs12_info=pkinit_pkcs12_info,
|
||||
_pkinit_ca_cert=pkinit_ca_cert,
|
||||
no_dnssec_validation=options.no_dnssec_validation,
|
||||
config_setup_ca=config.setup_ca,
|
||||
config_master_host_name=config.master_host_name,
|
||||
config_ca_host_name=config.ca_host_name,
|
||||
config_kra_host_name=config.kra_host_name,
|
||||
config_ips=[ str(ip) for ip in config.ips ],
|
||||
### ad trust ###
|
||||
dns_ip_addresses=[ str(ip) for ip
|
||||
in dns.ip_addresses ],
|
||||
dns_reverse_zones=dns.reverse_zones,
|
||||
rid_base=options.rid_base,
|
||||
secondary_rid_base=options.secondary_rid_base,
|
||||
adtrust_netbios_name=adtrust.netbios_name,
|
||||
adtrust_reset_netbios_name=adtrust.reset_netbios_name)
|
||||
ansible_module.exit_json(
|
||||
changed=True,
|
||||
ccache=ccache,
|
||||
installer_ccache=installer._ccache,
|
||||
subject_base=str(config.subject_base),
|
||||
forward_policy=options.forward_policy,
|
||||
_ca_enabled=ca_enabled,
|
||||
_ca_subject=str(options._ca_subject),
|
||||
_subject_base=str(options._subject_base) if options._subject_base
|
||||
is not None else None,
|
||||
_kra_enabled=kra_enabled,
|
||||
_ca_file=cafile,
|
||||
_top_dir=installer._top_dir,
|
||||
_add_to_ipaservers=add_to_ipaservers,
|
||||
_dirsrv_pkcs12_file=dirsrv_pkcs12_file,
|
||||
_dirsrv_pkcs12_info=dirsrv_pkcs12_info,
|
||||
_dirsrv_ca_cert=dirsrv_ca_cert,
|
||||
_http_pkcs12_file=http_pkcs12_file,
|
||||
_http_pkcs12_info=http_pkcs12_info,
|
||||
_http_ca_cert=http_ca_cert,
|
||||
_pkinit_pkcs12_file=pkinit_pkcs12_file,
|
||||
_pkinit_pkcs12_info=pkinit_pkcs12_info,
|
||||
_pkinit_ca_cert=pkinit_ca_cert,
|
||||
no_dnssec_validation=options.no_dnssec_validation,
|
||||
config_setup_ca=config.setup_ca,
|
||||
config_master_host_name=config.master_host_name,
|
||||
config_ca_host_name=config.ca_host_name,
|
||||
config_kra_host_name=config.kra_host_name,
|
||||
config_ips=[str(ip) for ip in config.ips],
|
||||
# ad trust
|
||||
dns_ip_addresses=[str(ip) for ip in dns.ip_addresses],
|
||||
dns_reverse_zones=dns.reverse_zones,
|
||||
rid_base=options.rid_base,
|
||||
secondary_rid_base=options.secondary_rid_base,
|
||||
adtrust_netbios_name=adtrust.netbios_name,
|
||||
adtrust_reset_netbios_name=adtrust.reset_netbios_name)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -69,25 +69,26 @@ import os
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, installer, DN, paths, # sysrestore,
|
||||
AnsibleModuleLog, installer, DN, paths,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, promote_openldap_conf
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
config_setup_ca=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -96,19 +97,20 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
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')
|
||||
installer.setup_ca = config_setup_ca
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
|
||||
# init #
|
||||
|
||||
@@ -136,5 +138,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -74,20 +74,21 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, promote_sssd
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
config_setup_ca=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -96,19 +97,20 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
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')
|
||||
installer.setup_ca = config_setup_ca
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
|
||||
# init #
|
||||
|
||||
@@ -136,5 +138,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -57,24 +57,25 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
krbinstance
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_file=dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -83,15 +84,15 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
@@ -139,5 +140,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -74,27 +74,28 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, api, redirect_stdout, adtrust
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### ad trust ###
|
||||
# ad trust
|
||||
enable_compat=dict(required=False, type='bool', default=False),
|
||||
rid_base=dict(required=False, type='int'),
|
||||
secondary_rid_base=dict(required=False, type='int'),
|
||||
### additional ###
|
||||
# additional
|
||||
adtrust_netbios_name=dict(required=True),
|
||||
adtrust_reset_netbios_name=dict(required=True, type='bool'),
|
||||
### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
setup_ca=dict(required=True),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -103,24 +104,27 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### ad trust ###
|
||||
# ad trust
|
||||
options.enable_compat = ansible_module.params.get('enable_compat')
|
||||
options.rid_base = ansible_module.params.get('rid_base')
|
||||
options.secondary_rid_base = ansible_module.params.get('secondary_rid_base') ### additional ###
|
||||
options.secondary_rid_base = ansible_module.params.get(
|
||||
'secondary_rid_base')
|
||||
# additional
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
adtrust.netbios_name = ansible_module.params.get('adtrust_netbios_name')
|
||||
adtrust.reset_netbios_name = \
|
||||
ansible_module.params.get('adtrust_reset_netbios_name')
|
||||
adtrust.reset_netbios_name = ansible_module.params.get(
|
||||
'adtrust_reset_netbios_name')
|
||||
|
||||
# init #
|
||||
|
||||
@@ -151,5 +155,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -118,26 +118,27 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
custodiainstance
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
pki_config_override=dict(required=False),
|
||||
#### server ###
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_kra_enabled=dict(required=False, type='bool'),
|
||||
_kra_host_name=dict(required=False),
|
||||
_dirsrv_pkcs12_info = dict(required=False),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_dirsrv_pkcs12_info=dict(required=False),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
@@ -146,7 +147,7 @@ def main():
|
||||
config_ca_host_name=dict(required=True),
|
||||
config_ips=dict(required=False, type='list', default=[]),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -155,27 +156,29 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### basic ###
|
||||
# basic
|
||||
options.pki_config_override = ansible_module.params.get(
|
||||
'pki_config_override')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
kra_enabled = ansible_module.params.get('_kra_enabled')
|
||||
kra_host_name = ansible_module.params.get('_kra_host_name')
|
||||
installer._dirsrv_pkcs12_info = ansible_module.params.get('_dirsrv_pkcs12_info')
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
installer._dirsrv_pkcs12_info = ansible_module.params.get(
|
||||
'_dirsrv_pkcs12_info')
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options._ca_subject = ansible_module.params.get('_ca_subject')
|
||||
if options._ca_subject is not None:
|
||||
@@ -185,7 +188,8 @@ def main():
|
||||
options._subject_base = DN(options._subject_base)
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
config_setup_ca = ansible_module.params.get('config_setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
config_ca_host_name = ansible_module.params.get('config_ca_host_name')
|
||||
config_ips = ansible_module_get_parsed_ip_addresses(ansible_module,
|
||||
"config_ips")
|
||||
@@ -218,7 +222,7 @@ def main():
|
||||
# There is a api.Backend.ldap2.connect call somewhere in ca, ds, dns or
|
||||
# ntpinstance
|
||||
api.Backend.ldap2.connect()
|
||||
#conn.connect(ccache=ccache)
|
||||
# conn.connect(ccache=ccache)
|
||||
|
||||
ansible_log.debug("-- INSTALL CA --")
|
||||
|
||||
@@ -246,5 +250,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -52,11 +52,12 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, redirect_stdout, configure_certmonger
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
argument_spec=dict(
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -74,5 +75,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -95,28 +95,29 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
gen_ReplicaConfig, gen_remote_api, api, redirect_stdout, custodiainstance
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_kra_enabled=dict(required=False, type='bool'),
|
||||
_kra_host_name=dict(required=False),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -125,24 +126,25 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
kra_enabled = ansible_module.params.get('_kra_enabled')
|
||||
kra_host_name = ansible_module.params.get('_kra_host_name')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
options._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
|
||||
@@ -199,5 +201,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -78,29 +78,30 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
ansible_module_get_parsed_ip_addresses
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### dns ###
|
||||
# dns
|
||||
zonemgr=dict(required=False),
|
||||
forwarders=dict(required=False, type='list', default=[]),
|
||||
forward_policy=dict(default=None, choices=['first', 'only']),
|
||||
no_dnssec_validation=dict(required=False, type='bool',
|
||||
default=False),
|
||||
### additional ###
|
||||
# additional
|
||||
dns_ip_addresses=dict(required=True, type='list'),
|
||||
dns_reverse_zones=dict(required=True, type='list'),
|
||||
ccache=dict(required=True),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
setup_ca=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -109,20 +110,20 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### dns ###
|
||||
# dns
|
||||
options.zonemgr = ansible_module.params.get('zonemgr')
|
||||
options.forwarders = ansible_module.params.get('forwarders')
|
||||
options.forward_policy = ansible_module.params.get('forward_policy')
|
||||
options.no_dnssec_validation = ansible_module.params.get(
|
||||
'no_dnssec_validationdnssec_validation')
|
||||
### additional ###
|
||||
# additional
|
||||
dns.ip_addresses = ansible_module_get_parsed_ip_addresses(
|
||||
ansible_module, 'dns_ip_addresses')
|
||||
dns.reverse_zones = ansible_module.params.get('dns_reverse_zones')
|
||||
@@ -130,7 +131,8 @@ def main():
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
|
||||
# init #
|
||||
|
||||
@@ -164,5 +166,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -146,10 +146,11 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
install_replica_ds, install_dns_records, ntpinstance, ScriptError
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
dm_password=dict(required=False, no_log=True),
|
||||
password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
@@ -158,27 +159,27 @@ def main():
|
||||
hostname=dict(required=False),
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
no_host_dns=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool'),
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool', default=False),
|
||||
dirsrv_config_file=dict(required=False),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
### client ###
|
||||
# client
|
||||
force_join=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
installer_ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_dirsrv_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_add_to_ipaservers = dict(required=True, type='bool'),
|
||||
_dirsrv_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
_add_to_ipaservers=dict(required=True, type='bool'),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
@@ -187,7 +188,7 @@ def main():
|
||||
config_ca_host_name=dict(required=True),
|
||||
config_ips=dict(required=False, type='list', default=[]),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -206,18 +207,19 @@ def main():
|
||||
options.host_name = ansible_module.params.get('hostname')
|
||||
options.ca_cert_files = ansible_module.params.get('ca_cert_files')
|
||||
options.no_host_dns = ansible_module.params.get('no_host_dns')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
options.dirsrv_config_file = ansible_module.params.get('dirsrv_config_file')
|
||||
### ssl certificate ###
|
||||
options.dirsrv_config_file = ansible_module.params.get(
|
||||
'dirsrv_config_file')
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
### client ###
|
||||
# client
|
||||
options.force_join = ansible_module.params.get('force_join')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.external_ca = ansible_module.params.get('external_ca')
|
||||
options.external_cert_files = ansible_module.params.get(
|
||||
'external_cert_files')
|
||||
@@ -225,14 +227,14 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
### additional ###
|
||||
#options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
# additional
|
||||
# options._host_name_overridden = ansible_module.params.get(
|
||||
# '_hostname_overridden')
|
||||
options.server = ansible_module.params.get('server')
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
|
||||
@@ -242,14 +244,16 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options._add_to_ipaservers = ansible_module.params.get('_add_to_ipaservers')
|
||||
options._add_to_ipaservers = ansible_module.params.get(
|
||||
'_add_to_ipaservers')
|
||||
|
||||
options._ca_subject = ansible_module.params.get('_ca_subject')
|
||||
options._subject_base = ansible_module.params.get('_subject_base')
|
||||
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
config_setup_ca = ansible_module.params.get('config_setup_ca')
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
config_ca_host_name = ansible_module.params.get('config_ca_host_name')
|
||||
config_ips = ansible_module_get_parsed_ip_addresses(ansible_module,
|
||||
"config_ips")
|
||||
@@ -345,5 +349,6 @@ def main():
|
||||
ds_suffix=str(ds.suffix),
|
||||
ds_ca_subject=str(ds.ca_subject))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -94,26 +94,27 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
install_http
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
config_master_host_name=dict(required=True),
|
||||
config_ca_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_ca_file=dict(required=False),
|
||||
_http_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_http_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -126,17 +127,17 @@ def main():
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
options.no_ui_redirect = ansible_module.params.get('no_ui_redirect')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ca_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
http_pkcs12_info = ansible_module.params.get('_http_pkcs12_info')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
@@ -157,12 +158,12 @@ def main():
|
||||
config.subject_base = options.subject_base
|
||||
config.dirman_password = dirman_password
|
||||
config.setup_ca = options.setup_ca
|
||||
#config.master_host_name = master_host_name
|
||||
# config.master_host_name = master_host_name
|
||||
config.ca_host_name = ca_host_name
|
||||
config.promote = installer.promote
|
||||
|
||||
remote_api = gen_remote_api(master_host_name, paths.ETC_IPA)
|
||||
#installer._remote_api = remote_api
|
||||
# installer._remote_api = remote_api
|
||||
|
||||
conn = remote_api.Backend.ldap2
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
@@ -227,5 +228,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -93,10 +93,11 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
kra
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
dm_password=dict(required=False, no_log=True),
|
||||
password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
@@ -106,18 +107,18 @@ def main():
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
no_host_dns=dict(required=False, type='bool', default=False),
|
||||
pki_config_override=dict(required=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool'),
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
setup_dns=dict(required=False, type='bool'),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
### client ###
|
||||
# client
|
||||
force_join=dict(required=False, type='bool'),
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
### additional ###
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
@@ -125,12 +126,12 @@ def main():
|
||||
_ca_enabled=dict(required=False, type='bool'),
|
||||
_kra_enabled=dict(required=False, type='bool'),
|
||||
_kra_host_name=dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_add_to_ipaservers = dict(required=True, type='bool'),
|
||||
_top_dir=dict(required=True),
|
||||
_add_to_ipaservers=dict(required=True, type='bool'),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -151,16 +152,16 @@ def main():
|
||||
options.no_host_dns = ansible_module.params.get('no_host_dns')
|
||||
options.pki_config_override = ansible_module.params.get(
|
||||
'pki_config_override')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
### client ###
|
||||
# client
|
||||
options.force_join = ansible_module.params.get('force_join')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.external_ca = ansible_module.params.get('external_ca')
|
||||
options.external_cert_files = ansible_module.params.get(
|
||||
'external_cert_files')
|
||||
@@ -168,7 +169,7 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options.ca_subject = ansible_module.params.get('ca_subject')
|
||||
### dns ###
|
||||
# dns
|
||||
options.reverse_zones = ansible_module.params.get('reverse_zones')
|
||||
options.no_reverse = ansible_module.params.get('no_reverse')
|
||||
options.auto_reverse = ansible_module.params.get('auto_reverse')
|
||||
@@ -176,11 +177,11 @@ def main():
|
||||
options.no_forwarders = ansible_module.params.get('no_forwarders')
|
||||
options.auto_forwarders = ansible_module.params.get('auto_forwarders')
|
||||
options.forward_policy = ansible_module.params.get('forward_policy')
|
||||
### additional ###
|
||||
# additional
|
||||
options.server = ansible_module.params.get('server')
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
#os.environ['KRB5CCNAME'] = ccache
|
||||
# os.environ['KRB5CCNAME'] = ccache
|
||||
os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
ca_enabled = ansible_module.params.get('_ca_enabled')
|
||||
@@ -191,7 +192,8 @@ def main():
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options._add_to_ipaservers = ansible_module.params.get('_add_to_ipaservers')
|
||||
options._add_to_ipaservers = ansible_module.params.get(
|
||||
'_add_to_ipaservers')
|
||||
|
||||
options._ca_subject = ansible_module.params.get('_ca_subject')
|
||||
options._subject_base = ansible_module.params.get('_subject_base')
|
||||
@@ -214,7 +216,7 @@ def main():
|
||||
remote_api = gen_remote_api(master_host_name, paths.ETC_IPA)
|
||||
installer._remote_api = remote_api
|
||||
|
||||
ccache = os.environ['KRB5CCNAME']
|
||||
# ccache = os.environ['KRB5CCNAME']
|
||||
|
||||
with redirect_stdout(ansible_log):
|
||||
ansible_log.debug("-- INSTALL KRA --")
|
||||
@@ -234,5 +236,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -78,26 +78,26 @@ from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, installer, DN, paths, sysrestore,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, # gen_remote_api,
|
||||
api, redirect_stdout, install_krb
|
||||
gen_ReplicaConfig, api, redirect_stdout, install_krb
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_pkinit_pkcs12_info = dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_pkinit_pkcs12_info=dict(required=False),
|
||||
_top_dir=dict(required=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -106,19 +106,21 @@ def main():
|
||||
# get parameters #
|
||||
|
||||
options = installer
|
||||
### server ###
|
||||
# server
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
config_master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
# additional
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get('_pkinit_pkcs12_info')
|
||||
installer._pkinit_pkcs12_info = ansible_module.params.get(
|
||||
'_pkinit_pkcs12_info')
|
||||
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
|
||||
@@ -173,5 +175,6 @@ def main():
|
||||
ansible_module.exit_json(changed=True,
|
||||
config_master_host_name=config.master_host_name)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -87,24 +87,25 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
ipautil
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
#### server ###
|
||||
argument_spec=dict(
|
||||
# server
|
||||
setup_ca=dict(required=False, type='bool'),
|
||||
setup_kra=dict(required=False, type='bool'),
|
||||
no_pkinit=dict(required=False, type='bool'),
|
||||
no_ui_redirect=dict(required=False, type='bool'),
|
||||
#### certificate system ###
|
||||
# certificate system
|
||||
subject_base=dict(required=True),
|
||||
#### additional ###
|
||||
# additional
|
||||
config_master_host_name=dict(required=True),
|
||||
ccache=dict(required=True),
|
||||
_ca_file=dict(required=False),
|
||||
_top_dir = dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -116,16 +117,16 @@ def main():
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
### certificate system ###
|
||||
# certificate system
|
||||
options.subject_base = ansible_module.params.get('subject_base')
|
||||
if options.subject_base is not None:
|
||||
options.subject_base = DN(options.subject_base)
|
||||
### additional ###
|
||||
# additional
|
||||
master_host_name = ansible_module.params.get('config_master_host_name')
|
||||
ccache = ansible_module.params.get('ccache')
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
#os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
#installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
# os.environ['KRB5CCNAME'] = ansible_module.params.get('installer_ccache')
|
||||
# installer._ccache = ansible_module.params.get('installer_ccache')
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
|
||||
@@ -163,5 +164,6 @@ def main():
|
||||
|
||||
ansible_module.exit_json(changed=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -56,12 +56,13 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
IPA_PYTHON_VERSION
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
### basic ###
|
||||
#dm_password=dict(required=False, no_log=True),
|
||||
#password=dict(required=False, no_log=True),
|
||||
argument_spec=dict(
|
||||
# basic
|
||||
# dm_password=dict(required=False, no_log=True),
|
||||
# password=dict(required=False, no_log=True),
|
||||
ip_addresses=dict(required=False, type='list', default=[]),
|
||||
domain=dict(required=False),
|
||||
servers=dict(required=False, type='list', default=[]),
|
||||
@@ -69,21 +70,21 @@ def main():
|
||||
hostname=dict(required=False),
|
||||
ca_cert_files=dict(required=False, type='list', default=[]),
|
||||
hidden_replica=dict(required=False, type='bool', default=False),
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=dict(required=False, type='bool', default=False),
|
||||
setup_kra=dict(required=False, type='bool', default=False),
|
||||
setup_dns=dict(required=False, type='bool', default=False),
|
||||
no_pkinit=dict(required=False, type='bool', default=False),
|
||||
dirsrv_config_file=dict(required=False),
|
||||
### ssl certificate ###
|
||||
# ssl certificate
|
||||
dirsrv_cert_files=dict(required=False, type='list', default=[]),
|
||||
http_cert_files=dict(required=False, type='list', default=[]),
|
||||
pkinit_cert_files=dict(required=False, type='list', default=[]),
|
||||
### client ###
|
||||
# client
|
||||
no_ntp=dict(required=False, type='bool', default=False),
|
||||
ntp_servers=dict(required=False, type='list', default=[]),
|
||||
ntp_pool=dict(required=False),
|
||||
### dns ###
|
||||
# dns
|
||||
no_reverse=dict(required=False, type='bool', default=False),
|
||||
auto_reverse=dict(required=False, type='bool', default=False),
|
||||
forwarders=dict(required=False, type='list', default=[]),
|
||||
@@ -100,10 +101,10 @@ def main():
|
||||
|
||||
# get parameters #
|
||||
|
||||
### basic ###
|
||||
#options.dm_password = ansible_module.params.get('dm_password')
|
||||
##options.password = ansible_module.params.get('password')
|
||||
#options.password = options.dm_password
|
||||
# basic
|
||||
# options.dm_password = ansible_module.params.get('dm_password')
|
||||
# # options.password = ansible_module.params.get('password')
|
||||
# options.password = options.dm_password
|
||||
options.ip_addresses = ansible_module_get_parsed_ip_addresses(
|
||||
ansible_module)
|
||||
options.domain_name = ansible_module.params.get('domain')
|
||||
@@ -112,21 +113,22 @@ def main():
|
||||
options.host_name = ansible_module.params.get('hostname')
|
||||
options.ca_cert_files = ansible_module.params.get('ca_cert_files')
|
||||
options.hidden_replica = ansible_module.params.get('hidden_replica')
|
||||
### server ###
|
||||
# server
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
options.setup_kra = ansible_module.params.get('setup_kra')
|
||||
options.setup_dns = ansible_module.params.get('setup_dns')
|
||||
options.no_pkinit = ansible_module.params.get('no_pkinit')
|
||||
options.dirsrv_config_file = ansible_module.params.get('dirsrv_config_file')
|
||||
### ssl certificate ###
|
||||
options.dirsrv_config_file = ansible_module.params.get(
|
||||
'dirsrv_config_file')
|
||||
# ssl certificate
|
||||
options.dirsrv_cert_files = ansible_module.params.get('dirsrv_cert_files')
|
||||
options.http_cert_files = ansible_module.params.get('http_cert_files')
|
||||
options.pkinit_cert_files = ansible_module.params.get('pkinit_cert_files')
|
||||
### client ###
|
||||
# client
|
||||
options.no_ntp = ansible_module.params.get('no_ntp')
|
||||
options.ntp_servers = ansible_module.params.get('ntp_servers')
|
||||
options.ntp_pool = ansible_module.params.get('ntp_pool')
|
||||
### dns ###
|
||||
# dns
|
||||
options.no_reverse = ansible_module.params.get('no_reverse')
|
||||
options.auto_reverse = ansible_module.params.get('auto_reverse')
|
||||
options.forwarders = ansible_module.params.get('forwarders')
|
||||
@@ -145,12 +147,12 @@ def main():
|
||||
else:
|
||||
installer.server = None
|
||||
# TODO: Kills ipa-client-install
|
||||
#if installer.replica_file is None:
|
||||
# installer.password = installer.admin_password
|
||||
#else:
|
||||
# installer.password = installer.dm_password
|
||||
# if installer.replica_file is None:
|
||||
# installer.password = installer.admin_password
|
||||
# else:
|
||||
# installer.password = installer.dm_password
|
||||
|
||||
#installer._ccache = os.environ.get('KRB5CCNAME')
|
||||
# installer._ccache = os.environ.get('KRB5CCNAME')
|
||||
|
||||
# If not defined, set domain from server name
|
||||
if installer.domain_name is None and installer.server is not None:
|
||||
@@ -165,17 +167,17 @@ def main():
|
||||
|
||||
# version specific tests #
|
||||
|
||||
#if options.setup_adtrust and not adtrust_imported:
|
||||
# #if "adtrust" not in options._allow_missing:
|
||||
# if options.setup_adtrust and not adtrust_imported:
|
||||
# # if "adtrust" not in options._allow_missing:
|
||||
# ansible_module.fail_json(msg="adtrust can not be imported")
|
||||
# #else:
|
||||
# # else:
|
||||
# # options.setup_adtrust = False
|
||||
# # ansible_module.warn(msg="adtrust is not supported, disabling")
|
||||
|
||||
#if options.setup_kra and not kra_imported:
|
||||
# #if "kra" not in options._allow_missing:
|
||||
# if options.setup_kra and not kra_imported:
|
||||
# # if "kra" not in options._allow_missing:
|
||||
# ansible_module.fail_json(msg="kra can not be imported")
|
||||
# #else:
|
||||
# # else:
|
||||
# # options.setup_kra = False
|
||||
# # ansible_module.warn(msg="kra is not supported, disabling")
|
||||
|
||||
@@ -276,32 +278,38 @@ def main():
|
||||
msg="You must specify at least one of --forwarder, "
|
||||
"--auto-forwarders, or --no-forwarders options")
|
||||
|
||||
if installer.dirsrv_config_file is not None and not os.path.exists(installer.dirsrv_config_file):
|
||||
ansible_module.fail_json(msg="File %s does not exist." % installer.dirsrv_config_file)
|
||||
if installer.dirsrv_config_file is not None and \
|
||||
not os.path.exists(installer.dirsrv_config_file):
|
||||
ansible_module.fail_json(
|
||||
msg="File %s does not exist." % installer.dirsrv_config_file)
|
||||
|
||||
if installer.ca_cert_files is not None:
|
||||
if not isinstance(installer.ca_cert_files, list):
|
||||
ansible_module.fail_json(msg="Expected list, got {!r}".format(installer.ca_cert_files))
|
||||
ansible_module.fail_json(
|
||||
msg="Expected list, got {!r}".format(installer.ca_cert_files))
|
||||
for cert in installer.ca_cert_files:
|
||||
if not os.path.exists(cert):
|
||||
ansible_module.fail_json(msg="'%s' does not exist" % cert)
|
||||
if not os.path.isfile(cert):
|
||||
ansible_module.fail_json(msg="'%s' is not a file" % cert)
|
||||
if not os.path.isabs(cert):
|
||||
ansible_module.fail_json(msg="'%s' is not an absolute file path" % cert)
|
||||
ansible_module.fail_json(
|
||||
msg="'%s' is not an absolute file path" % cert)
|
||||
|
||||
try:
|
||||
x509.load_certificate_from_file(cert)
|
||||
except Exception:
|
||||
ansible_module.fail_json(msg="'%s' is not a valid certificate file" % cert)
|
||||
ansible_module.fail_json(
|
||||
msg="'%s' is not a valid certificate file" % cert)
|
||||
|
||||
if installer.ip_addresses is not None:
|
||||
for value in installer.ip_addresses:
|
||||
try:
|
||||
ipautil.CheckedIPAddress(value)
|
||||
except Exception as e:
|
||||
ansible_module.fail_json(msg="invalid IP address {0}: {1}".format(
|
||||
value, e))
|
||||
ansible_module.fail_json(
|
||||
msg="invalid IP address {0}: {1}".format(
|
||||
value, e))
|
||||
|
||||
if installer.domain_name is not None:
|
||||
validate_domain_name(installer.domain_name)
|
||||
@@ -314,7 +322,7 @@ def main():
|
||||
try:
|
||||
with redirect_stdout(ansible_log):
|
||||
common_check(options.no_ntp)
|
||||
except Exception as msg: #ScriptError as msg:
|
||||
except Exception as msg: # ScriptError as msg:
|
||||
_msg = str(msg)
|
||||
if "server is already configured" in _msg:
|
||||
ansible_module.exit_json(changed=False,
|
||||
@@ -330,8 +338,8 @@ def main():
|
||||
client_enrolled = client_fstore.has_files()
|
||||
|
||||
if not client_enrolled:
|
||||
## One-step replica installation
|
||||
#if options.dm_password and options.password:
|
||||
# # One-step replica installation
|
||||
# if options.dm_password and options.password:
|
||||
# ansible_module.fail_json(
|
||||
# msg="--password and --admin-password options are "
|
||||
# "mutually exclusive")
|
||||
@@ -347,18 +355,19 @@ def main():
|
||||
ansible_module.exit_json(
|
||||
changed=False,
|
||||
ipa_python_version=IPA_PYTHON_VERSION,
|
||||
### basic ###
|
||||
# basic
|
||||
domain=options.domain_name,
|
||||
realm=options.realm_name,
|
||||
hostname=options.host_name,
|
||||
### server ###
|
||||
# server
|
||||
setup_adtrust=options.setup_adtrust,
|
||||
setup_kra=options.setup_kra,
|
||||
server=options.server,
|
||||
### additional ###
|
||||
# additional
|
||||
client_enrolled=client_enrolled,
|
||||
change_master_for_certmonger=change_master_for_certmonger,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user