- Sep 07, 2021
-
-
Thomas Woerner authored
The staticmethod member_error_handler is handing the default member related failures that can occur for modules with member support. This can simply be enabled with fail_on_member_errors=True for execute_ipa_commands. An exception handler is also now usable with execute_ipa_commands. In addition to the the exception it is also getting the same user defined arguments that the result_handler is getting. handle_result has been renamed in result_handler and handle_result_user_args has been renamed to handlers_user_args. Additionally the errors list does not need to be defined in the module. The method execute_ipa_commands is doing this internally and is also adding error: error to handlers_user_args if the handler is having errors in the argspec and errors is not yet set in handlers_user_args. Tests have been added to make sure that no user args for the handler have been set without an own result or exception handler. Also the use of fail_on_member_errors together with a result_andler is leading to an error.
-
- Sep 03, 2021
-
-
Thomas Woerner authored
ipadnszone: add check mode support
-
Thomas Woerner authored
dnszone: remove variable `serial`.
-
Rafael Guterres Jeffman authored
New IPAAnsibleModule class
-
- Sep 02, 2021
-
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
Moved ipamodule_base_spec into IPAAnsibleModule. This simplifies to add addtitional base vars to derived classes without the need to dusplicae the code to extend argument_spec. Removed execute_api_command. This is not used anymore. Removed get_ipamodule_base_vars. This is not used anymore. Removed self.ipaadmin_* and self.ccache_* from IPAAnsibleModule.__init__ These are not used and therefore can be removed.
-
Thomas Woerner authored
execute_ipa_commands executes IPA API commands from the given command list. With the handle_result and handle_result_user_args it is possible to have a handling of the result return by the ipa commands for example to return passwords. Parameters commands: list of string tuple The list of commands in the form (name, command and args) For commands that do not require a 'name', None needs be used. handle_result: function The user function to handle results of the single commands handle_result_user_args: dict (user args mapping) The user args to pass to handle_result function Example (ipauser module) def handle_result(result, command, name, args, exit_args): if "random" in args and command in ["user_add", "user_mod"] \ and "randompassword" in result["result"]: exit_args.setdefault(name, {})["randompassword"] = \ result["result"]["randompassword"] exit_args = {} changed = module.execute_ipa_commands(commands, handle_result, exit_args=exit_args) if len(names) == 1: ansible_module.exit_json(changed=changed, user=exit_args[names[0]]) else: ansible_module.exit_json(changed=changed, user=exit_args)
-
Rafael Guterres Jeffman authored
Use IPAAnsibleModule methods and ipamodule_base_docs ducument fragment.
-
Rafael Guterres Jeffman authored
Use IPAAnsibleModule methods and ipamodule_base_docs ducument fragment.
-
Rafael Guterres Jeffman authored
By making IPAAnsibleModule the base class of FreeIPABaseModule, instead of AnsibleModule, some methods on FreeIPABaseModule can be removed and suport for commom parameters in modules using the older class can use the same commom parameters (ipaadmin_principal and ipaadmin_password) as the other parameters. This will also allow easier deprecation of FreeIPABaseModule, which is hard to maintain. To be able to use IPAAnsibleModule as the base class, it was moved within the file, to position before FreeIPABaseModule declaration. This patch also modifies IPAAnsibleModule by: * removing usage of `self` in methods not requiring it, turning the methods into @statimethod; * adding comments to all the methods in IPAAnsibleModule, which makes it easier to understand what the individual methods do, and what their parameters represent.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
iparole: Add 'new_name' as an alias to 'rename'.
-
Thomas Woerner authored
templates: Use `become: no` in tests by default.
-
- Sep 01, 2021
-
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
ipaadmin_variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module.
-
Thomas Woerner authored
Use IPAAnsibleModule and ipamodule_base_docs in the templates of utils/new_module. ipaadmin_password lines in the examples have been added, ipaadmin_ variables are handled by IPAAnsibleModule, ansible_module.params_get is used to get the parameters and ansible_module.ipa_connect is used to simplify the module. ipamodule+member.py.in is additionally using gen_add_list and gen_intersection_list to reduce the command calls to the changes only.
-