Update the apt cache when the repo changes.

master
Andrea Dell'Amico 3 months ago
parent 0983dcd8c5
commit 1f7d1577dc
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF

@ -1,25 +1,4 @@
---
- name: Remove grafana
when: not grafana_enabled
tags: [grafana]
block:
- name: Ensure that grafana is stopped and disabled
ansible.builtin.service:
name: grafana-server
state: stopped
enabled: false
- name: Remove the grafana deb packages
ansible.builtin.apt:
name: "{{ grafana_packages }}"
state: absent
- name: Install the grafana deb repository
ansible.builtin.apt_repository:
repo: '{{ grafana_repo }}'
state: absent
update_cache: true
- name: Install grafana
when: grafana_enabled
tags: [grafana]
@ -49,6 +28,11 @@
signed_by: "{{ grafana_repo_key_file }}"
state: present
enabled: true
register: grafana_repo
- name: Update the apt cache
ansible.builtin.apt:
update_cache: yes
when: grafana_repo is changed
- name: Install the grafana packages
ansible.builtin.apt:
pkg: "{{ grafana_packages }}"

Loading…
Cancel
Save