blob: 01aa5a4a63eacf5910b571222950d0b7707c9647 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
---
- name: Install GnuPG
apt:
name: gnupg2
become: yes
- name: Install Grafana STABLE Repository
copy:
dest: /etc/apt/sources.list.d/grafana.list
content: 'deb [signed-by=/usr/share/keyrings/grafana-keyring.asc] https://packages.grafana.com/oss/deb stable main'
become: yes
register: install_repo
- name: Install Grafana Repo Key
get_url:
url: https://packages.grafana.com/gpg.key
dest: /usr/share/keyrings/grafana-keyring.key
become: yes
register: key_download
- name: dearmor key
shell: gpg --dearmor /usr/share/keyrings/grafana-keyring.key > /usr/share/keyrings/grafana-keyring.asc
when: key_download.changed
- name: Update APT cache
apt:
update_cache: yes
become: yes
when: install_repo.changed
- name: Install Grafana
apt:
name: grafana
become: yes
notify: Restart Grafana
- name: Check for changed cert
command: /bin/true
when: cert_changed
notify: Restart Grafana
- name: Install configuration
template:
src: '{{ item }}.j2'
dest: '/etc/grafana/{{ item }}'
owner: root
group: grafana
mode: '640'
become: yes
loop:
- grafana.ini
- ldap.toml
notify: Restart Grafana
|