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

Module defaults support #659

Closed
2bPro opened this issue Jul 9, 2024 · 1 comment
Closed

Module defaults support #659

2bPro opened this issue Jul 9, 2024 · 1 comment

Comments

@2bPro
Copy link

2bPro commented Jul 9, 2024

SUMMARY

Modules share parameters such as login_port, login_database, login_user, and login_password. It would be very useful if these could be specified via module defaults like so:

- name: Configure MongoDB block
  module_defaults:
  community.mongodb.all:
    login_host: "{{ config.host }}"
    login_port: "{{ config.port }}"
    login_user: "admin"
    login_password: "{{ vault_admin_password }}"
  block:
    - name: Configure roles
       community.mongodb.role:
         name: changeOwnPassword
         privileges:
           - resource:
                db: admin
                collection: ""
             actions:
                - changeOwnPassword
     - name: Configure users
       community.mongodb.user:
         name: manager
         password: "{{ vault_manager_password }}"
         roles:
           - db: admin
             role: changeOwnPassword

See community.postgresql collection as an example for enabling this.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Collection-level configuration

@rhysmeister
Copy link
Collaborator

Done in #660

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

No branches or pull requests

2 participants