diff --git a/galaxy.yml b/galaxy.yml index 9740ba3d570c9d691b9709a22c331f7dfbfb7bfa..e379f6866b31df54e695f21ffd9d904fb6a06b0f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -18,6 +18,7 @@ license_file: "COPYING" dependencies: tags: + - "system" - "identity" - "ipa" - "freeipa" diff --git a/roles/ipareplica/library/ipareplica_setup_kra.py b/roles/ipareplica/library/ipareplica_setup_kra.py index 8e7b5f6f77065676fc8493e6cb2c6b17c92cf12d..3149c104900d03b9ec08e103bdbecdd9f043d486 100644 --- a/roles/ipareplica/library/ipareplica_setup_kra.py +++ b/roles/ipareplica/library/ipareplica_setup_kra.py @@ -96,9 +96,6 @@ options: config_master_host_name: description: The config master_host_name setting required: no - ccache: - description: The local ccache - required: no installer_ccache: description: The installer ccache setting required: no @@ -172,7 +169,6 @@ def main(): # additional server=dict(required=True), config_master_host_name=dict(required=True), - ccache=dict(required=True), installer_ccache=dict(required=True), _ca_enabled=dict(required=False, type='bool'), _kra_enabled=dict(required=False, type='bool'), @@ -232,8 +228,6 @@ def main(): # 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'] = ansible_module.params.get('installer_ccache') installer._ccache = ansible_module.params.get('installer_ccache') ca_enabled = ansible_module.params.get('_ca_enabled') @@ -268,8 +262,6 @@ def main(): remote_api = gen_remote_api(master_host_name, paths.ETC_IPA) installer._remote_api = remote_api - # ccache = os.environ['KRB5CCNAME'] - with redirect_stdout(ansible_log): ansible_log.debug("-- INSTALL KRA --") diff --git a/roles/ipareplica/library/ipareplica_setup_krb.py b/roles/ipareplica/library/ipareplica_setup_krb.py index 0671df8baa5f20e841088c3508cd1b8becc2e512..7763f76ff0708b1e57d43f409869f62f104e8b4f 100644 --- a/roles/ipareplica/library/ipareplica_setup_krb.py +++ b/roles/ipareplica/library/ipareplica_setup_krb.py @@ -155,19 +155,19 @@ def main(): with redirect_stdout(ansible_log): argspec = inspect.getargspec(install_krb) if "promote" in argspec.args: - krb = install_krb( + install_krb( config, setup_pkinit=not options.no_pkinit, pkcs12_info=pkinit_pkcs12_info, promote=promote) else: if "fstore" not in argspec.args: - krb = install_krb( + install_krb( config, setup_pkinit=not options.no_pkinit, pkcs12_info=pkinit_pkcs12_info) else: - krb = install_krb( + install_krb( config, setup_pkinit=not options.no_pkinit, pkcs12_info=pkinit_pkcs12_info, diff --git a/roles/ipareplica/tasks/install.yml b/roles/ipareplica/tasks/install.yml index 3345bebaf537a3b1ed1e2f3a2925dbdabbbee0ad..fe81a4d1d80b2fe00eb81f7acca41caffeada8b5 100644 --- a/roles/ipareplica/tasks/install.yml +++ b/roles/ipareplica/tasks/install.yml @@ -606,7 +606,6 @@ server: "{{ result_ipareplica_test.server }}" config_master_host_name: "{{ result_ipareplica_prepare.config_master_host_name }}" - ccache: "{{ result_ipareplica_prepare.ccache }}" installer_ccache: "{{ result_ipareplica_prepare.installer_ccache }}" _ca_enabled: "{{ result_ipareplica_prepare._ca_enabled }}" _kra_enabled: "{{ result_ipareplica_prepare._kra_enabled }}" diff --git a/roles/ipaserver/library/ipaserver_set_ds_password.py b/roles/ipaserver/library/ipaserver_set_ds_password.py index 164a0ac5d1cc3977fa1454e52e040362bbdaad90..007730241ed22b3d63bf728b588e89880cde7e4e 100644 --- a/roles/ipaserver/library/ipaserver_set_ds_password.py +++ b/roles/ipaserver/library/ipaserver_set_ds_password.py @@ -58,7 +58,7 @@ options: description: The starting value for the IDs range (default random) required: no idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: no no_hbac_allow: description: Don't install allow_all HBAC rule diff --git a/roles/ipaserver/library/ipaserver_setup_ca.py b/roles/ipaserver/library/ipaserver_setup_ca.py index 524d1aa9edebfbb5f56d3a5ede364ad148d0bb95..faaf66018a7cbffcde3ead96d53fac88af258473 100644 --- a/roles/ipaserver/library/ipaserver_setup_ca.py +++ b/roles/ipaserver/library/ipaserver_setup_ca.py @@ -79,7 +79,7 @@ options: description: The starting value for the IDs range (default random) required: no idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: no no_hbac_allow: description: Don't install allow_all HBAC rule diff --git a/roles/ipaserver/library/ipaserver_setup_ds.py b/roles/ipaserver/library/ipaserver_setup_ds.py index 7e327405765caa03d1402a2e4d8d3182ef9cbeca..fc49d62a246bcd23b12e7bdade8a3c0243244f00 100644 --- a/roles/ipaserver/library/ipaserver_setup_ds.py +++ b/roles/ipaserver/library/ipaserver_setup_ds.py @@ -55,7 +55,7 @@ options: description: The starting value for the IDs range (default random) required: no idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: no no_hbac_allow: description: Don't install allow_all HBAC rule diff --git a/roles/ipaserver/library/ipaserver_setup_http.py b/roles/ipaserver/library/ipaserver_setup_http.py index 0518d0886fee1762ec5d686429e44add0ee8c29f..f5479f5d152250a565fef71841aa21c02092ff54 100644 --- a/roles/ipaserver/library/ipaserver_setup_http.py +++ b/roles/ipaserver/library/ipaserver_setup_http.py @@ -111,7 +111,7 @@ options: description: The starting value for the IDs range (default random) required: no idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: no domainlevel: description: The domain level diff --git a/roles/ipaserver/library/ipaserver_setup_krb.py b/roles/ipaserver/library/ipaserver_setup_krb.py index 06256ff1167cb7ec408755475c5cd5400a0d5c21..d86714672cff3864943aacaacb02a27ebcb212e2 100644 --- a/roles/ipaserver/library/ipaserver_setup_krb.py +++ b/roles/ipaserver/library/ipaserver_setup_krb.py @@ -98,7 +98,7 @@ options: description: The starting value for the IDs range (default random) required: no idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: no no_reverse: description: Do not create new reverse DNS zone diff --git a/roles/ipaserver/library/ipaserver_test.py b/roles/ipaserver/library/ipaserver_test.py index 822efb8974a52f3763eef21a6cf49ded7aef4bb2..71afabcf6e7ee4b18ef0eb631e77af26da7ff9b7 100644 --- a/roles/ipaserver/library/ipaserver_test.py +++ b/roles/ipaserver/library/ipaserver_test.py @@ -79,7 +79,7 @@ options: description: The starting value for the IDs range (default random) required: yes idmax: - description: The max value for the IDs range (default: idstart+199999) + description: The max value for the IDs range (default idstart+199999) required: yes no_pkinit: description: Disable pkinit setup steps diff --git a/utils/build-galaxy-release.sh b/utils/build-galaxy-release.sh index fc6bcdd6a0b0af06f81bbe92dc964ef94e850eab..f6e55a9deccd49c873ee969c27d5f874eb37ccce 100644 --- a/utils/build-galaxy-release.sh +++ b/utils/build-galaxy-release.sh @@ -1,36 +1,40 @@ #!/bin/bash +namespace="freeipa" +collection="ansible_freeipa" +collection_prefix="${namespace}.${collection}" + galaxy_version=$(git describe --tags | sed -e "s/^v//") -echo $galaxy_version | grep "-" -q || galaxy_version="${galaxy_version}-1" +echo $galaxy_version | grep "-" -q || galaxy_version="${galaxy_version}" sed -i -e "s/version: .*/version: \"$galaxy_version\"/" galaxy.yml find . -name "*~" -exec rm {} \; -sed -i -e "s/ansible.module_utils.ansible_freeipa_module/ansible_collections.freeipa.ansible_freeipa.plugins.module_utils.ansible_freeipa_module/" plugins/modules/*.py +sed -i -e "s/ansible.module_utils.ansible_freeipa_module/ansible_collections.${collection_prefix}.plugins.module_utils.ansible_freeipa_module/" plugins/modules/*.py cd plugins/module_utils && { - ln -s ../../roles/ipa*/module_utils/*.py . + ln -s ../../roles/*/module_utils/*.py . cd ../.. } cd plugins/modules && { - sed -i -e "s/ansible.module_utils.ansible_ipa_/ansible_collections.freeipa.ansible_freeipa.plugins.module_utils.ansible_ipa_/" ../../roles/ipa*/library/*.py - ln -s ../../roles/ipa*/library/*.py . + sed -i -e "s/ansible.module_utils.ansible_ipa_/ansible_collections.${collection_prefix}.plugins.module_utils.ansible_ipa_/" ../../roles/*/library/*.py + ln -s ../../roles/*/library/*.py . cd ../.. } [ ! -x plugins/action_plugins ] && mkdir plugins/action_plugins cd plugins/action_plugins && { - ln -s ../../roles/ipa*/action_plugins/*.py . + ln -s ../../roles/*/action_plugins/*.py . cd ../.. } -for x in roles/ipa*/tasks/*.yml; do - python utils/galaxyify-playbook.py "$x" +for x in roles/*/tasks/*.yml; do + python utils/galaxyfy-playbook.py "$x" "ipa" "$collection_prefix" done for x in $(find playbooks -name "*.yml" -print); do - python utils/galaxyify-playbook.py "$x" + python utils/galaxyfy-playbook.py "$x" "ipa" "$collection_prefix" done #git diff @@ -43,4 +47,3 @@ rm plugins/modules/ipareplica_* rm plugins/modules/ipaclient_* rm plugins/action_plugins/ipaclient_* git reset --hard - diff --git a/utils/galaxyify-playbook.py b/utils/galaxyfy-playbook.py similarity index 63% rename from utils/galaxyify-playbook.py rename to utils/galaxyfy-playbook.py index c2ad620904954a6baf1f32e3defbabd4f78733ad..3810ba3c7a748396b79b9fc108759e32bd02dbeb 100644 --- a/utils/galaxyify-playbook.py +++ b/utils/galaxyfy-playbook.py @@ -2,11 +2,14 @@ import sys import re -def galaxify_playbook(playbook_in): - p1 = re.compile('(ipa.*:)$') - p2 = re.compile('(.*:) (ipa.*)$') +def galaxify_playbook(playbook_in, project_prefix, collection_prefix): + p1 = re.compile('(%s.*:)$' % project_prefix) + p2 = re.compile('(.*:) (%s.*)$' % project_prefix) lines = [] + pattern1 = r'%s.\1' % collection_prefix + pattern2 = r'\1 %s.\2' % collection_prefix + with open(playbook_in) as in_f: changed = False changeable = False @@ -22,14 +25,13 @@ def galaxify_playbook(playbook_in): elif stripped.startswith("include_role:"): include_role = True elif include_role and stripped.startswith("name:"): - line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line) + line = p2.sub(pattern2, line) changed = True elif changeable and stripped.startswith("- role:"): - line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line) + line = p2.sub(pattern2, line) changed = True - elif changeable and not stripped.startswith( - "freeipa.ansible_freeipa."): - line = p1.sub(r'freeipa.ansible_freeipa.\1', line) + elif changeable and not stripped.startswith(collection_prefix): + line = p1.sub(pattern1, line) changed = True lines.append(line) @@ -40,4 +42,4 @@ def galaxify_playbook(playbook_in): out_f.write(line) -galaxify_playbook(sys.argv[1]) +galaxify_playbook(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/utils/gen_module_docs.py b/utils/gen_module_docs.py index a09a6530c885051de482cb53d01ac0186396cdd5..4994a3466b058b2eb09fac0ed1a9a07ca94aa74b 100644 --- a/utils/gen_module_docs.py +++ b/utils/gen_module_docs.py @@ -120,7 +120,7 @@ param_docs = { "allow_zone_overlap": "Create DNS zone even if it already exists", "skip_conncheck": "Skip connection check to remote master", "idstart": "The starting value for the IDs range (default random)", - "idmax": "The max value for the IDs range (default: idstart+199999)", + "idmax": "The max value for the IDs range (default idstart+199999)", "no_hbac_allow": "Don't install allow_all HBAC rule", "domainlevel": "The domain level", "external_ca_type": "Type of the external CA",