aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/apache/tasks/main.yml8
-rw-r--r--roles/influxdb/tasks/main.yml8
-rw-r--r--roles/mariadb/tasks/main.yml1
-rw-r--r--roles/sssd/tasks/main.yml1
4 files changed, 14 insertions, 4 deletions
diff --git a/roles/apache/tasks/main.yml b/roles/apache/tasks/main.yml
index 9e7e904..e60ed65 100644
--- a/roles/apache/tasks/main.yml
+++ b/roles/apache/tasks/main.yml
@@ -10,11 +10,17 @@
dest: /etc/apt/sources.list.d/sury.list
content: 'deb https://packages.sury.org/php/ {{ ansible_facts.distribution_release }} main'
become: yes
+ register: install_repo
+
+- name: Update APT Cache
+ apt:
+ update_cache: yes
+ become: yes
+ when: install_repo.changed
- name: Install general packages
apt:
name: '{{ ["apache2", "libapache2-mpm-itk"] + php_versions }}'
- update_cache: yes
become: yes
- name: Install extensions
diff --git a/roles/influxdb/tasks/main.yml b/roles/influxdb/tasks/main.yml
index bc908bf..abdda9d 100644
--- a/roles/influxdb/tasks/main.yml
+++ b/roles/influxdb/tasks/main.yml
@@ -17,10 +17,16 @@
src: influxdb.list.j2
dest: /etc/apt/sources.list.d/influxdb.list
become: yes
+ register: install_repo
-- name: Install Packages
+- name: Update APT Cache
apt:
update_cache: yes
+ become: yes
+ when: install_repo.changed
+
+- name: Install Packages
+ apt:
name:
- curl
- python3-influxdb
diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml
index f1dc10f..79d7ef0 100644
--- a/roles/mariadb/tasks/main.yml
+++ b/roles/mariadb/tasks/main.yml
@@ -5,7 +5,6 @@
- mariadb-client
- mariadb-server
- python3-pymysql
- update_cache: yes
become: yes
- name: Config File
diff --git a/roles/sssd/tasks/main.yml b/roles/sssd/tasks/main.yml
index b50cac6..a7f2b5e 100644
--- a/roles/sssd/tasks/main.yml
+++ b/roles/sssd/tasks/main.yml
@@ -5,7 +5,6 @@
- sssd
- libpam-sss
- libnss-sss
- update_cache: yes
become: yes
- name: Install SSSD Config file