2018-12-06 02:59:47 +08:00
|
|
|
---
|
|
|
|
- name: create /etc/grafana and /var/lib/grafana
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ grafana_uid }}"
|
2019-07-31 04:09:47 +08:00
|
|
|
group: "{{ grafana_uid }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
recurse: true
|
|
|
|
with_items:
|
|
|
|
- /etc/grafana
|
|
|
|
- /var/lib/grafana
|
|
|
|
|
|
|
|
- name: ship systemd service
|
2019-04-08 21:40:25 +08:00
|
|
|
template:
|
2019-05-13 22:21:16 +08:00
|
|
|
src: grafana-server.service.j2
|
|
|
|
dest: "/etc/systemd/system/grafana-server.service"
|
2018-12-06 02:59:47 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2019-05-16 16:56:06 +08:00
|
|
|
|
|
|
|
- name: start the grafana-server service
|
|
|
|
systemd:
|
|
|
|
name: grafana-server
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
daemon_reload: yes
|
2019-08-23 02:29:40 +08:00
|
|
|
failed_when: false
|