diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index ba2544f2d8c86b12f8ede004adbe9fc73df0aeb3..728af00ac31f924fc90166d5a7d0a32e894c2944 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -1132,6 +1132,7 @@ else: self.deprecate( msg="FreeIPABaseModule is deprecated. Use IPAAnsibleModule.", + version="1.5.0" ) # Status of an execution. Will be changed to True @@ -1174,7 +1175,8 @@ else: "FreeIPABaseModule is deprecated. Use IPAAnsibleModule. " "Use 'AnsibleFreeIPAParams.get_ipa_command_args()', " "Instantiate it using the class 'ipa_params_mapping'." - ) + ), + version="1.5.0" ) mapping = IPAParamMapping(self, self.ipa_param_mapping) return mapping.get_ipa_command_args(**kwargs) @@ -1185,6 +1187,7 @@ else: msg=( "FreeIPABaseModule is deprecated. Use IPAAnsibleModule. " ), + version="1.5.0" ) pass # pylint: disable=unnecessary-pass @@ -1217,6 +1220,7 @@ else: msg=( "FreeIPABaseModule is deprecated. Use IPAAnsibleModule. " ), + version="1.5.0" ) self.process_command_result(name, command, args, result) @@ -1234,6 +1238,7 @@ else: "To aid in porting to IPAAnsibleModule, change to " "'FreeIPABaseModule.process_results'." ), + version="1.5.0" ) if "completed" in result: @@ -1255,6 +1260,7 @@ else: "FreeIPABaseModule require_ipa_attrs_change() is " "deprecated. Use ansible_freeipa_module.compare_args()." ), + version="1.5.0" ) equal = compare_args_ipa(self, command_args, ipa_attrs) return not equal @@ -1265,6 +1271,7 @@ else: msg=( "FreeIPABaseModule is deprecated. Use IPAAnsibleModule." ), + version="1.5.0" ) ipaapi_context = self.params_get("ipaapi_context") with self.ipa_connect(context=ipaapi_context): diff --git a/plugins/modules/ipaautomember.py b/plugins/modules/ipaautomember.py index b99879af650332aef3f762dc097b992b22fa51b4..c3b8e1a9048bc2cf289df627d4d32e3d91730fac 100644 --- a/plugins/modules/ipaautomember.py +++ b/plugins/modules/ipaautomember.py @@ -194,19 +194,23 @@ def main(): argument_spec=dict( # general inclusive=dict(type="list", - aliases=["automemberinclusiveregex"], default=None, + aliases=["automemberinclusiveregex"], + default=None, options=dict( key=dict(type="str", required=True), expression=dict(type="str", required=True) ), - elements="dict", required=False), - exclusive=dict(type="list", aliases=[ - "automemberexclusiveregex"], default=None, + elements="dict", + required=False), + exclusive=dict(type="list", + aliases=["automemberexclusiveregex"], + default=None, options=dict( key=dict(type="str", required=True), expression=dict(type="str", required=True) ), - elements="dict", required=False), + elements="dict", + required=False), name=dict(type="list", aliases=["cn"], default=None, required=True), description=dict(type="str", default=None), diff --git a/plugins/modules/ipaconfig.py b/plugins/modules/ipaconfig.py index 4b2df6a591032a8caafa3a65ba9677b4bf5a2936..2a155bdfed49b39be87f03bb69aacb830cb00452 100644 --- a/plugins/modules/ipaconfig.py +++ b/plugins/modules/ipaconfig.py @@ -299,7 +299,7 @@ def main(): "KDC:Disable Last Success", "KDC:Disable Lockout", "KDC:Disable Default Preauth for SPNs", - ""]), # noqa E128 + ""]), # noqa E128 selinuxusermaporder=dict(type="list", required=False, aliases=['ipaselinuxusermaporder']), selinuxusermapdefault=dict(type="str", required=False, @@ -365,15 +365,15 @@ def main(): if params.get("ipadomainresolutionorder", None): params["ipadomainresolutionorder"] = \ - ":".join(params["ipadomainresolutionorder"]) + ":".join(params["ipadomainresolutionorder"]) if params.get("ipausersearchfields", None): params["ipausersearchfields"] = \ - ",".join(params["ipausersearchfields"]) + ",".join(params["ipausersearchfields"]) if params.get("ipagroupsearchfields", None): params["ipagroupsearchfields"] = \ - ",".join(params["ipagroupsearchfields"]) + ",".join(params["ipagroupsearchfields"]) # verify limits on INT values. args_with_limits = [ @@ -418,12 +418,12 @@ def main(): if ansible_module.argument_spec.get(k): arg_type = ansible_module.argument_spec[k]['type'] if k in ( - 'ipaselinuxusermaporder', 'domain_resolution_order' - ): + 'ipaselinuxusermaporder', 'domain_resolution_order' + ): exit_args[k] = result.get(key)[0].split('$') elif k in ( - 'usersearch', 'groupsearch' - ): + 'usersearch', 'groupsearch' + ): exit_args[k] = result.get(key)[0].split(',') elif isinstance(value, str) and arg_type == "list": exit_args[k] = [value] diff --git a/plugins/modules/ipadnsconfig.py b/plugins/modules/ipadnsconfig.py index f6d4c468c6114d45d6d8bfdc7b8272755f9d3dda..7b82a076b9ffce2e5d90f3e6b5b7e635422ae68c 100644 --- a/plugins/modules/ipadnsconfig.py +++ b/plugins/modules/ipadnsconfig.py @@ -165,24 +165,23 @@ def gen_args(module, state, dnsconfig, forwarders, forward_policy, def main(): forwarder_spec = dict( - ip_address=dict(type=str, required=True), - port=dict(type=int, required=False, default=None) + ip_address=dict(type=str, required=True), + port=dict(type=int, required=False, default=None) ) ansible_module = IPAAnsibleModule( - argument_spec=dict( - # dnsconfig - forwarders=dict(type='list', default=None, required=False, - options=dict(**forwarder_spec)), - forward_policy=dict(type='str', required=False, default=None, - choices=['only', 'first', 'none']), - allow_sync_ptr=dict(type='bool', required=False, default=None), - - # general - state=dict(type="str", default="present", - choices=["present", "absent"]), - - ) + argument_spec=dict( + # dnsconfig + forwarders=dict(type='list', default=None, required=False, + options=dict(**forwarder_spec)), + forward_policy=dict(type='str', required=False, default=None, + choices=['only', 'first', 'none']), + allow_sync_ptr=dict(type='bool', required=False, default=None), + + # general + state=dict(type="str", default="present", + choices=["present", "absent"]), + ) ) ansible_module._ansible_debug = True diff --git a/plugins/modules/ipadnsrecord.py b/plugins/modules/ipadnsrecord.py index dc72803120148ff58c3b18d6ab1a35b136de1ed7..1f5e787e5ae474b74762747c71095805f2123273 100644 --- a/plugins/modules/ipadnsrecord.py +++ b/plugins/modules/ipadnsrecord.py @@ -1108,12 +1108,13 @@ def configure_module(): name=dict(type="list", aliases=["record_name"], default=None, required=False), - records=dict(type="list", default=None, + records=dict(type="list", + default=None, options=dict( - # Here name is a simple string - name=dict(type='str', required=True, - aliases=['record_name']), - **record_spec), + # Here name is a simple string + name=dict(type='str', required=True, + aliases=['record_name']), + **record_spec), ), # general diff --git a/plugins/modules/ipadnszone.py b/plugins/modules/ipadnszone.py index 38fdcefa46a4a09f7e70fc224008b8b202011156..ae9b75163cb4470f968744619fe672c7cf9d0352 100644 --- a/plugins/modules/ipadnszone.py +++ b/plugins/modules/ipadnszone.py @@ -550,10 +550,10 @@ def main(): ansible_module.check_ipa_params() ansible_module.define_ipa_commands() changed = ansible_module.execute_ipa_commands( - ansible_module.commands, - result_handler=DNSZoneModule.process_results, - exit_args=exit_args - ) + ansible_module.commands, + result_handler=DNSZoneModule.process_results, + exit_args=exit_args + ) ansible_module.exit_json(changed=changed, **exit_args) diff --git a/plugins/modules/ipagroup.py b/plugins/modules/ipagroup.py index 979bf62318d2b47a8a58362c991062d7ff99dda8..55855f446e407f43a9590a8b9d05e1f6ea0a1d9a 100644 --- a/plugins/modules/ipagroup.py +++ b/plugins/modules/ipagroup.py @@ -393,13 +393,13 @@ def main(): # If yes: modify # Also if it is a modification from nonposix to posix # or nonposix to external. - if not compare_args_ipa(ansible_module, args, - res_find) or \ - ( - not is_posix_group(res_find) and - not is_external_group(res_find) and - (posix or external) - ): + if not compare_args_ipa( + ansible_module, args, res_find + ) or ( + not is_posix_group(res_find) and + not is_external_group(res_find) and + (posix or external) + ): if posix: args['posix'] = True if external: diff --git a/plugins/modules/iparole.py b/plugins/modules/iparole.py index 912cfc1e8dcb52610f703a81cf7a1f1332f57d36..dc5b692221dd832d09c0a8314a5e20eaef4720f5 100644 --- a/plugins/modules/iparole.py +++ b/plugins/modules/iparole.py @@ -199,7 +199,7 @@ def ensure_absent_state(module, name, action, res_find): member_args = {} for key in ['user', 'group', 'host', 'hostgroup']: items = member_intersect( - module, key, 'member_%s' % key, res_find) + module, key, 'member_%s' % key, res_find) if items: member_args[key] = items @@ -298,7 +298,7 @@ def ensure_members_are_present(module, name, res_find): member_args = {} for key in ['user', 'group', 'host', 'hostgroup']: items = member_difference( - module, key, 'member_%s' % key, res_find) + module, key, 'member_%s' % key, res_find) if items: member_args[key] = items diff --git a/plugins/modules/ipaservice.py b/plugins/modules/ipaservice.py index 9eb87548cd087f231e3285d17a2e88078da77054..706f6436eb9ec8abe58b696b2526b3011904181b 100644 --- a/plugins/modules/ipaservice.py +++ b/plugins/modules/ipaservice.py @@ -577,7 +577,7 @@ def main(): args.get("krbprincipalauthind", [""]) == res_find.get("krbprincipalauthind", [""]) ) - ): + ): del args["krbprincipalauthind"] if not compare_args_ipa(ansible_module, args, diff --git a/plugins/modules/ipauser.py b/plugins/modules/ipauser.py index b737f74971aed62a2cd4fb4b0405a4e4061cb86c..a1146fb6b15b4bbe4805ec0d8821cdb94250f5a4 100644 --- a/plugins/modules/ipauser.py +++ b/plugins/modules/ipauser.py @@ -824,14 +824,17 @@ def main(): # general name=dict(type="list", aliases=["login"], default=None, required=False), - users=dict(type="list", aliases=["login"], default=None, + users=dict(type="list", + aliases=["login"], + default=None, options=dict( # Here name is a simple string name=dict(type="str", required=True), # Add user specific parameters **user_spec ), - elements='dict', required=False), + elements='dict', + required=False), # deleted preserve=dict(required=False, type='bool', default=None), diff --git a/plugins/modules/ipavault.py b/plugins/modules/ipavault.py index 76d3ae2d77248bdf1419ba054ce09823ac9ac4e7..01574c7b369abd2f629b9ba4109c2978e528164c 100644 --- a/plugins/modules/ipavault.py +++ b/plugins/modules/ipavault.py @@ -634,7 +634,7 @@ def main(): vault_password_file=dict(type="str", required=False, default=None, no_log=False, aliases=[ - 'password_file', "old_password_file" + 'password_file', "old_password_file" ]), new_password=dict(type="str", required=False, default=None, no_log=True), diff --git a/roles/ipabackup/library/ipabackup_get_backup_dir.py b/roles/ipabackup/library/ipabackup_get_backup_dir.py index d9eeb51231e13cb6aa958299b59af43f18c30401..53f3e1f87c85c10cbf0fa091217c7023607af873 100644 --- a/roles/ipabackup/library/ipabackup_get_backup_dir.py +++ b/roles/ipabackup/library/ipabackup_get_backup_dir.py @@ -45,7 +45,7 @@ EXAMPLES = ''' # Get IPA_BACKUP_DIR from ipaplatform - name: Get IPA_BACKUP_DIR from ipaplatform ipabackup_get_backup_dir: - register result + register: result ''' RETURN = ''' diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt new file mode 100644 index 0000000000000000000000000000000000000000..f1c7540586fd93e74b919823207945f96ccde9bb --- /dev/null +++ b/tests/sanity/ignore-2.12.txt @@ -0,0 +1,55 @@ +plugins/module_utils/ansible_freeipa_module.py compile-2.6!skip +plugins/module_utils/ansible_freeipa_module.py import-2.6!skip +plugins/module_utils/ansible_freeipa_module.py pylint:ansible-bad-import-from +plugins/module_utils/ansible_freeipa_module.py pylint:ansible-bad-function +plugins/module_utils/ansible_freeipa_module.py pylint:ansible-format-automatic-specification +plugins/module_utils/ansible_freeipa_module.py pylint:ansible-deprecated-no-collection-name +plugins/modules/ipaclient_get_facts.py compile-2.6!skip +plugins/modules/ipaclient_get_facts.py import-2.6!skip +plugins/modules/ipaclient_api.py pylint:ansible-format-automatic-specification +plugins/modules/ipaclient_join.py pylint:ansible-format-automatic-specification +plugins/modules/ipaclient_test.py pylint:ansible-format-automatic-specification +plugins/modules/ipaconfig.py compile-2.6!skip +plugins/modules/ipaconfig.py import-2.6!skip +plugins/modules/ipadnsrecord.py compile-2.6!skip +plugins/modules/ipadnsrecord.py import-2.6!skip +plugins/modules/ipadnsrecord.py pylint:ansible-format-automatic-specification +plugins/modules/ipadnsrecord.py pylint:use-maxsplit-arg +plugins/modules/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification +plugins/modules/ipareplica_prepare.py pylint:ansible-format-automatic-specification +plugins/modules/ipareplica_test.py pylint:ansible-format-automatic-specification +plugins/modules/ipaserver_setup_ca.py compile-2.6!skip +plugins/modules/ipaserver_setup_ca.py import-2.6!skip +plugins/modules/ipaserver_test.py pylint:ansible-format-automatic-specification +plugins/modules/ipaservice.py compile-2.6!skip +plugins/modules/ipaservice.py import-2.6!skip +plugins/modules/ipavault.py compile-2.6!skip +plugins/modules/ipavault.py import-2.6!skip +roles/ipaclient/library/ipaclient_api.py pylint:ansible-format-automatic-specification +roles/ipaclient/library/ipaclient_join.py pylint:ansible-format-automatic-specification +roles/ipaclient/library/ipaclient_test.py pylint:ansible-format-automatic-specification +roles/ipareplica/library/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification +roles/ipareplica/library/ipareplica_prepare.py pylint:ansible-format-automatic-specification +roles/ipareplica/library/ipareplica_test.py pylint:ansible-format-automatic-specification +roles/ipaserver/library/ipaserver_test.py pylint:ansible-format-automatic-specification +roles/ipareplica/module_utils/ansible_ipa_replica.py pylint:ansible-format-automatic-specification +tests/external-signed-ca-with-automatic-copy/external-ca.sh shebang!skip +tests/pytests/conftest.py pylint:ansible-format-automatic-specification +tests/user/users.sh shebang!skip +tests/user/users_absent.sh shebang!skip +tests/utils.py pylint:ansible-format-automatic-specification +tests/utils.py pylint:subprocess-run-check +utils/ansible-doc-test shebang!skip +utils/ansible-ipa-client-install shebang!skip +utils/ansible-ipa-replica-install shebang!skip +utils/ansible-ipa-server-install shebang!skip +utils/build-galaxy-release.sh shebang!skip +utils/build-srpm.sh shebang!skip +utils/changelog shebang!skip +utils/galaxyfy-README.py shebang!skip +utils/galaxyfy-module-EXAMPLES.py shebang!skip +utils/galaxyfy-playbook.py shebang!skip +utils/galaxyfy.py shebang!skip +utils/gen_modules_docs.sh shebang!skip +utils/lint_check.sh shebang!skip +utils/new_module shebang!skip diff --git a/utils/build-galaxy-release.sh b/utils/build-galaxy-release.sh index 87d2136abc4a42770d29d9875e7b99ebda9c9ccf..3e6bd4f2cc32411f040fcd1ed499901c40512a19 100755 --- a/utils/build-galaxy-release.sh +++ b/utils/build-galaxy-release.sh @@ -84,7 +84,7 @@ rm plugins/module_utils/ansible_ipa_* rm plugins/modules/ipaserver_* rm plugins/modules/ipareplica_* rm plugins/modules/ipaclient_* +rm plugins/modules/ipabackup_* rm plugins/action/ipaclient_* -rm plugins/action/ipabackup_* rmdir plugins/action git reset --hard diff --git a/utils/gen_module_docs.py b/utils/gen_module_docs.py index b3ac9f57e38b6f8af60e81d48f20d9010f361a9f..e046f986115b4bd89a3f4dfa08b77a2b47374b60 100644 --- a/utils/gen_module_docs.py +++ b/utils/gen_module_docs.py @@ -26,7 +26,7 @@ param_docs = { "sssd": "The installer sssd setting", "dnsok": "The installer dnsok setting", - "dm_password": "Directory Manager password", + "dm_password": "Directory Manager password", "password": "Admin user kerberos password", "ip_addresses": "List of Master Server IP Addresses", "domain": "Primary DNS domain of the IPA deployment", @@ -55,10 +55,9 @@ param_docs = { "no_pkinit": "Disable pkinit setup steps", "no_ui_redirect": "Do not automatically redirect to the Web UI", "external_ca": "External ca setting", - "setup_adtrust": "Configure AD trust capability", "external_cert_files": [ - "File containing the IPA CA certificate and the external CA certificate", - "chain" + "File containing the IPA CA certificate and the external CA " + "certificate chain" ], "reverse_zones": "The reverse DNS zones to use", "no_reverse": "Do not create new reverse DNS zone", @@ -132,8 +131,8 @@ param_docs = { "debug": "Turn on extra debugging", "basedn": "The basedn of the IPA server (of the form dc=example,dc=com)", "allow_repair": [ - "Allow repair of already joined hosts. Contrary to ipaclient_force_join", - "the host entry will not be changed on the server" + "Allow repair of already joined hosts. Contrary to " + "ipaclient_force_join the host entry will not be changed on the server" ], "backup": "File to backup", "fqdn": [