mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Extend module_defaults
by adding default groups for cloud modules (#44127)
Extends `module_defaults` by adding a prefix to defaults `group/` which denotes a builtin list of modules. Initial groups are: `group/aws`, `group/azure`, and `group/gcp`
This commit is contained in:
parent
fdcb883ac0
commit
4c8808ec9d
7 changed files with 675 additions and 13 deletions
|
@ -559,6 +559,11 @@ class TaskExecutor:
|
|||
tmp_args = module_defaults[self._task.action].copy()
|
||||
tmp_args.update(self._task.args)
|
||||
self._task.args = tmp_args
|
||||
if self._task.action in C.config.module_defaults_groups:
|
||||
for group in C.config.module_defaults_groups.get(self._task.action, []):
|
||||
tmp_args = (module_defaults.get('group/{0}'.format(group)) or {}).copy()
|
||||
tmp_args.update(self._task.args)
|
||||
self._task.args = tmp_args
|
||||
|
||||
# And filter out any fields which were set to default(omit), and got the omit token value
|
||||
omit_token = variables.get('omit')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue