feat: initial installation role for grafana
This commit is contained in:
29
tasks/redhat.yml
Normal file
29
tasks/redhat.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Add Grafana yum repository
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
[grafana]
|
||||
name=grafana
|
||||
baseurl=https://rpm.grafana.com
|
||||
repo_gpgcheck=1
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://rpm.grafana.com/gpg.key
|
||||
sslverify=1
|
||||
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
|
||||
dest: /etc/yum.repos.d/grafana.repo
|
||||
mode: '0644'
|
||||
become: true
|
||||
|
||||
- name: Install Grafana
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ grafana_package }}"
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Enable and start Grafana service
|
||||
ansible.builtin.systemd:
|
||||
name: grafana-server
|
||||
enabled: "{{ grafana_service_enabled }}"
|
||||
state: "{{ grafana_service_state }}"
|
||||
become: true
|
||||
Reference in New Issue
Block a user