test: fix syntax for ansible-lint
This commit is contained in:
parent
b240f61f50
commit
37ed35956c
2 changed files with 27 additions and 36 deletions
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: restart grafana
|
- name: Restart grafana
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: grafana-server
|
name: grafana-server
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,96 +1,87 @@
|
||||||
---
|
---
|
||||||
- name: install dependencies packages
|
- name: Install dependencies packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
- gpg
|
- gpg
|
||||||
- unzip
|
- unzip
|
||||||
retries: 2
|
|
||||||
register: result
|
|
||||||
until: result is succeeded
|
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: add repository key
|
- name: Add repository key
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://apt.grafana.com/gpg.key
|
url: https://apt.grafana.com/gpg.key
|
||||||
dest: /usr/share/keyrings/grafana.key
|
dest: /usr/share/keyrings/grafana.key
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
retries: 2
|
|
||||||
register: result
|
|
||||||
until: result is succeeded
|
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: add repository
|
- name: Add repository
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main
|
repo: deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main
|
||||||
filename: grafana
|
filename: grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: install grafana package
|
- name: Install grafana package
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- grafana
|
- grafana
|
||||||
retries: 2
|
|
||||||
register: result
|
|
||||||
until: result is succeeded
|
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: copy default environment variables file
|
- name: Copy default environment variables file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: default.j2
|
src: default.j2
|
||||||
dest: /etc/default/grafana-server
|
dest: /etc/default/grafana-server
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart grafana
|
notify: Restart grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: copy configuration file
|
- name: Copy configuration file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: grafana.ini.j2
|
src: grafana.ini.j2
|
||||||
dest: /etc/grafana/grafana.ini
|
dest: /etc/grafana/grafana.ini
|
||||||
owner: root
|
owner: root
|
||||||
group: grafana
|
group: grafana
|
||||||
mode: 0640
|
mode: 0640
|
||||||
notify: restart grafana
|
notify: Restart grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: copy ldap configuration file
|
- name: Copy ldap configuration file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ldap.toml.j2
|
src: ldap.toml.j2
|
||||||
dest: /etc/grafana/ldap.toml
|
dest: /etc/grafana/ldap.toml
|
||||||
owner: root
|
owner: root
|
||||||
group: grafana
|
group: grafana
|
||||||
mode: 0640
|
mode: 0640
|
||||||
notify: restart grafana
|
notify: Restart grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: install official plugins
|
- name: Install official plugins
|
||||||
community.grafana.grafana_plugin:
|
community.grafana.grafana_plugin:
|
||||||
name: '{{ item.name }}'
|
name: "{{ item.name }}"
|
||||||
version: '{{ item.version | default("latest") }}'
|
version: "{{ item.version | default('latest') }}"
|
||||||
state: '{{ item.state | default("present") }}'
|
state: "{{ item.state | default('present') }}"
|
||||||
loop: '{{ grafana_plugins | selectattr("url", "undefined") }}'
|
loop: "{{ grafana_plugins | selectattr('url', 'undefined') }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: '{{ item.name }}'
|
label: "{{ item.name }}"
|
||||||
notify: restart grafana
|
notify: Restart grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: install unofficial plugins
|
- name: Install unofficial plugins
|
||||||
community.grafana.grafana_plugin:
|
community.grafana.grafana_plugin:
|
||||||
name: '{{ item.name }}'
|
name: "{{ item.name }}"
|
||||||
grafana_plugin_url: '{{ item.url }}'
|
grafana_plugin_url: "{{ item.url }}"
|
||||||
version: '{{ item.version | default("latest") }}'
|
version: "{{ item.version | default('latest') }}"
|
||||||
state: '{{ item.state | default("present") }}'
|
state: "{{ item.state | default('present') }}"
|
||||||
loop: '{{ grafana_plugins | selectattr("url", "defined") }}'
|
loop: "{{ grafana_plugins | selectattr('url', 'defined') }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: '{{ item.name }}'
|
label: "{{ item.name }}"
|
||||||
notify: restart grafana
|
notify: Restart grafana
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: enable and start service
|
- name: Enable and start service
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: grafana-server
|
name: grafana-server
|
||||||
state: started
|
state: started
|
||||||
|
|
Loading…
Reference in a new issue