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

Declare Module default groups #224

Open
Derioss opened this issue Jun 17, 2024 · 0 comments
Open

Declare Module default groups #224

Derioss opened this issue Jun 17, 2024 · 0 comments

Comments

@Derioss
Copy link

Derioss commented Jun 17, 2024

Official Ansible doc

Hello !

it's very nice to declare group in meta/runtime.yml for remove some duplicate code when we use this grafana module.

for example:

- name: Usage of module is_default
  module_defaults:
    group/grafana:
      grafana_url: "https://{{ monitoring_grafana_server_name }}"
      grafana_user: "{{ monitoring_grafana_user }}"
      grafana_password: "{{ monitoring_grafana_pass }}"
      use_proxy: false
      validate_certs: false
  block:
    - name: Add prometheus datasource
      community.grafana.grafana_datasource:
        name: prometheus
        ds_type: prometheus
        access: direct
        is_default: true
        ds_url: http://prometheus:9090

    - name: Load grafana dashboard
      community.grafana.grafana_dashboard:
        folder: "{{ item.folder }}"
        dashboard_id: "{{ item.dashboard_id }}"
        dashboard_revision: "{{ item.dashboard_revision }}"

Thanks !

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

1 participant