You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
924 B
YAML

---
- name: Install required packages for Grafana
ansible.builtin.apt:
pkg:
- gpg
state: present
- name: Add Grafana repo apt key
ansible.builtin.apt_key:
url: https://apt.grafana.com/gpg.key
state: present
when:
ansible_distribution == 'Debian'
- name: Add Grafana stable repository
ansible.builtin.apt_repository:
repo: deb https://apt.grafana.com stable main
when:
ansible_distribution == 'Debian'
- name: Install Grafana when running Debian
ansible.builtin.apt:
pkg: grafana
update_cache: true
force_apt_get: true
when:
ansible_distribution == 'Debian'
- name: Template Grafana service file
ansible.builtin.template:
src: grafana-server.service.j2
dest: /lib/systemd/system/grafana-server.service
owner: root
group: root
mode: "0644"
- name: Refresh systemd service files
ansible.builtin.systemd:
daemon_reload: true
...