You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add action_group to enable module defaults groups (#800)
This enables support for the module defaults groups feature introduced in ansible-core 2.12. Using module defaults groups one can provide default values (e.g. token, url, etc.) for a group of modules instead of having to specify them for every used module. For more details see: https://docs.ansible.com/ansible/latest/user_guide/playbooks_module_defaults.html#module-defaults-groups
This commit adds all modules available in this collection to an action group called 'netbox'. This change is backwards compatible. Older versions of Ansible just ignore this.
Copy file name to clipboardExpand all lines: docs/getting_started/how-to-use/advanced.rst
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -298,4 +298,36 @@ IP address to be within **Test VRF 2**.
298
298
299
299
We can now see that the IP address is now within VRF with ID 2.
300
300
301
-
Hopefully this shines some light on this useful feature to allow you, as the user, to define your specific needs for finding a unique object within your NetBox instance.
301
+
Hopefully this shines some light on this useful feature to allow you, as the user, to define your specific needs for finding a unique object within your NetBox instance.
302
+
303
+
304
+
Using Module defaults groups
305
+
--------------------------------------------
306
+
307
+
Ansible-core >= 2.12 provide a useful feature called [Module defaults groups](https://docs.ansible.com/ansible/latest/user_guide/playbooks_module_defaults.html#module-defaults-groups) that lets us specify default parameters for a group of modules in a single place. We can use the action_group ``netbox`` that contains all modules from this collection to avoid setting e.g. ``token`` and ``url`` on each task and thus reduce boilerplate code.
0 commit comments