2018-12-06 02:59:47 +08:00
|
|
|
---
|
|
|
|
- name: create grafana user
|
|
|
|
user:
|
|
|
|
name: grafana
|
|
|
|
shell: '/bin/false'
|
|
|
|
createhome: false
|
|
|
|
system: true
|
|
|
|
|
|
|
|
- name: create /etc/grafana and /var/lib/grafana
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ grafana_uid }}"
|
|
|
|
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
|
|
|
|
failed_when: false
|