diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 719e31a1..2c125a28 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -30,6 +30,12 @@ - grafana_datasources - grafana_notifications - grafana_dashboards + tags: + - grafana_install + - grafana_configure + - grafana_datasources + - grafana_notifications + - grafana_dashboards - name: Install ansible.builtin.include_tasks: @@ -38,6 +44,8 @@ become: true tags: - grafana_install + tags: + - grafana_install - name: Configure ansible.builtin.include_tasks: @@ -46,6 +54,8 @@ become: true tags: - grafana_configure + tags: + - grafana_configure - name: Plugins ansible.builtin.include_tasks: @@ -53,6 +63,8 @@ apply: tags: - grafana_configure + tags: + - grafana_configure when: "grafana_plugins != []" - name: "Restart grafana before configuring datasources and dashboards" @@ -85,6 +97,9 @@ tags: - grafana_configure - grafana_run + tags: + - grafana_configure + - grafana_run when: "grafana_api_keys | length > 0" - name: Datasources @@ -95,6 +110,10 @@ - grafana_configure - grafana_datasources - grafana_run + tags: + - grafana_configure + - grafana_datasources + - grafana_run when: "grafana_datasources != []" - name: Notifications @@ -105,6 +124,10 @@ - grafana_configure - grafana_notifications - grafana_run + tags: + - grafana_configure + - grafana_notifications + - grafana_run when: "grafana_alert_notifications | length > 0 or grafana_alert_resources | length > 0" - name: Dashboards @@ -115,6 +138,10 @@ - grafana_configure - grafana_dashboards - grafana_run + tags: + - grafana_configure + - grafana_dashboards + - grafana_run when: "grafana_dashboards | length > 0 or __found_dashboards | length > 0" vars: __found_dashboards: "{{ lookup('fileglob', grafana_dashboards_dir + '/*.json', wantlist=True) }}"