Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Default Action Group #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wandersonwhcr
Copy link

@wandersonwhcr wandersonwhcr commented Aug 15, 2023

SUMMARY

This PR defines an action group for all collection modules.

When same module is frequently called with same arguments, we can use module_defaults to avoid duplications. Since Ansible 2.7, we can group modules that share common sets of parameters. And since ansible-core 2.12, collections can define its own groups via action_groups on runtime.yml.

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • rabbitmq action group
ADDITIONAL INFORMATION

Before:

# playbook.yaml
- name: rabbitmq
  hosts: all
  module_defaults:
    community.rabbitmq.rabbitmq_exchanges:
      login_user: "admin"
      login_password: "admin"
    community.rabbitmq.rabbitmq_queues:
      login_user: "admin"
      login_password: "admin"
    # ...
  roles:
    - "exchanges"
    - "queues"

After:

# playbook.yaml
- name: rabbitmq
  hosts: all
  module_defaults:
    group/rabbitmq:
      login_user: "admin"
      login_password: "admin"
  roles:
    - "exchanges"
    - "queues"

@csmart
Copy link
Collaborator

csmart commented Mar 17, 2024

hi @wandersonwhcr thanks for this contribution! I'm wondering whether the group can be set to rabbitmq rather than the FQDN? If so, this might make it a little more clean?

@wandersonwhcr
Copy link
Author

Hi @csmart! Of course!

Changed as requested.

But I think these pipeline errors are not caused because of my changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants