add action_groups for module_defaults
add action_groups in meta/runtime.yml.
This allows module_defaults group feature. https://docs.ansible.com/ansible/latest/user_guide/playbooks_module_defaults.html#module-defaults-groups
It becomes able to specify common options such as host username and password without specifying per tasks or using environment variables.
---
- hosts: apic
gather_facts: no
module_defaults:
group/cisco.aci.aci:
host: "{{ ansible_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: create tenant
cisco.aci.aci_tenant:
tenant: test_tenant01
state: present
- name: create ap
cisco.aci.aci_ap:
tenant: test_tenant01
ap: test_ap01
state: present
Thank you for your approval!
One thing I noticed is that in this PR you have a non-standard module on the list aci_bulk_static_binding_to_epg. Probably needs cleanup before merge.
@rafmuller The following modules including aci_bulk_static_binding_to_epg have been merged into the main branch since the version 2.2.0 release.
aci_bulk_static_binding_to_epg#228aci_ntp_policy#229aci_ntp_server#229
Therefore, these modules should be included in the list in the next release.
Added the following modules that were added after submitting this PR.
- aci_aaa_ssh_auth
- aci_aaa_user_domain
- aci_aaa_user_role
- aci_l3out_logical_interface_profile_ospf_policy
@akira6592 is there a way to just have a wildcard? This looks like it will be a pain to manage this list.
@akira6592 Have you seen my question above?
@lhercot Sorry for the delay in replying.
Unfortunately there does not seem to be a way to specify a module with wildcards.
Other collections (e.g., amazon.aws) also maintain listings.
If there is a workaround, it would be to add an explanation in the Contributing to this collection section of the README.md, something like "When adding a module, also add it to meta/runtime.yml".
Thanks for the contribution!
To avoid having to manually modify the list, I have added a small function to our release script (which also build our changelog for new releases) which compile the list and output it in the meta/runtime.yml file.
You can see more details here: https://github.com/ciscoecosystem/release_script/commit/4f693d3e41d568bb4737fdd70859a3d7953027e6
Thank you for merging and adding the process to generate action_groups.
FYI, we have decided to rename the group to all so it will be group/cisco.aci.all which will be more logical if we decide to introduce other groups and avoid the repetition.