generic-ansible/deploy-grafana.yaml
2024-08-14 10:31:11 -07:00

26 lines
965 B
YAML

---
- name: Setup Grafana
become: true
tasks:
- name: "Download Grafana Repository Key"
# HACK: apt_key has been deprecated, and its current (2023) replacement appears to be nothing
#ansible.builtin.apt_key:
# url: https://download.grafana.com/linux/ubuntu/gpg
# id: 7EA0A9C3F273FCD8
# state: present
ansible.builtin.get_url:
url: https://apt.grafana.com/gpg.key
dest: /tmp/grafana.gpg.armor
- name: "Add Grafana Repository Key"
ansible.builtin.shell:
cmd: gpg --dearmor -o /etc/apt/keyrings/grafana.gpg < /tmp/grafana.gpg.armor
creates: /etc/apt/keyrings/grafana.gpg
- name: "Add Grafana Repository"
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main"
filename: grafana
state: present
- name: "Install Grafana packages"
ansible.builtin.apt:
name:
- grafana-enterprise