From 8851f8f63150ba3ef587be2e91bf1ac69d9587ae Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 25 Aug 2016 12:58:15 +0300 Subject: [PATCH] Revert "Only update packages indexes if the cache is 1 hour old" This reverts commit 201165cff662caad9b51508272e7f8f2eece7b0c. Turns out this actually breaks initial deployments, because the cache gets updated in the first task, then you add sources for nginx and mariadb, but it doesn't update the indexes because the cache is < 3600 seconds old, so you end up getting the distro's versions of nginx and mariadb. --- roles/common/tasks/iptables_Debian.yml | 2 +- roles/common/tasks/iptables_Ubuntu.yml | 2 +- roles/common/tasks/packages_Debian.yml | 2 +- roles/common/tasks/packages_Ubuntu.yml | 2 +- roles/mariadb/tasks/main.yml | 2 +- roles/nginx/tasks/main.yml | 2 +- roles/php-fpm/tasks/Debian.yml | 2 +- roles/php-fpm/tasks/Ubuntu.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/common/tasks/iptables_Debian.yml b/roles/common/tasks/iptables_Debian.yml index ff9f09d..7a90b16 100644 --- a/roles/common/tasks/iptables_Debian.yml +++ b/roles/common/tasks/iptables_Debian.yml @@ -1,7 +1,7 @@ --- - name: Install firewalld and deps when: ansible_distribution_major_version == '8' - apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600 + apt: pkg={{ item }} state=latest with_items: - firewalld - tidy diff --git a/roles/common/tasks/iptables_Ubuntu.yml b/roles/common/tasks/iptables_Ubuntu.yml index ea603b0..e13becd 100644 --- a/roles/common/tasks/iptables_Ubuntu.yml +++ b/roles/common/tasks/iptables_Ubuntu.yml @@ -1,7 +1,7 @@ --- - name: Install iptables-persistent when: ansible_distribution_version == '14.04' - apt: pkg=iptables-persistent update_cache=yes cache_valid_time=3600 + apt: pkg=iptables-persistent update_cache=yes tags: packages - name: Copy /etc/iptables/rules.v4 diff --git a/roles/common/tasks/packages_Debian.yml b/roles/common/tasks/packages_Debian.yml index 4b08cbc..f0a072c 100644 --- a/roles/common/tasks/packages_Debian.yml +++ b/roles/common/tasks/packages_Debian.yml @@ -3,7 +3,7 @@ template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644 - name: Install base packages - apt: name={{ item }} update_cache=yes cache_valid_time=3600 + apt: name={{ item }} update_cache=yes with_items: - git - tmux diff --git a/roles/common/tasks/packages_Ubuntu.yml b/roles/common/tasks/packages_Ubuntu.yml index 63761e5..22f8405 100644 --- a/roles/common/tasks/packages_Ubuntu.yml +++ b/roles/common/tasks/packages_Ubuntu.yml @@ -7,7 +7,7 @@ when: ansible_distribution_version == '14.04' - name: Upgrade base OS - apt: upgrade=dist update_cache=yes cache_valid_time=3600 + apt: upgrade=dist update_cache=yes - name: Install base packages apt: pkg={{ item }} diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml index 1459f5c..6794b6d 100644 --- a/roles/mariadb/tasks/main.yml +++ b/roles/mariadb/tasks/main.yml @@ -15,7 +15,7 @@ tags: mariadb, packages - name: Install mariadb-server - apt: name={{ item }} state=present update_cache=yes cache_valid_time=3600 + apt: name={{ item }} state=present update_cache=yes with_items: - mariadb-server - python-mysqldb # for ansible diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 2e7efcc..790e35d 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -8,7 +8,7 @@ tags: nginx, packages - name: Install nginx - apt: pkg=nginx update_cache=yes state=latest cache_valid_time=3600 + apt: pkg=nginx update_cache=yes state=latest tags: nginx, packages - name: Copy nginx configs diff --git a/roles/php-fpm/tasks/Debian.yml b/roles/php-fpm/tasks/Debian.yml index 8699d2e..371c975 100644 --- a/roles/php-fpm/tasks/Debian.yml +++ b/roles/php-fpm/tasks/Debian.yml @@ -1,6 +1,6 @@ --- - name: Install php5-fpm and deps - apt: name={{ item }} state=present update_cache=yes cache_valid_time=3600 + apt: name={{ item }} state=present update_cache=yes with_items: - php5-fpm # for WordPress diff --git a/roles/php-fpm/tasks/Ubuntu.yml b/roles/php-fpm/tasks/Ubuntu.yml index 7eb14a3..c2ec940 100644 --- a/roles/php-fpm/tasks/Ubuntu.yml +++ b/roles/php-fpm/tasks/Ubuntu.yml @@ -1,6 +1,6 @@ --- - name: Install php7.0-fpm and deps - apt: name={{ item }} state=present update_cache=yes cache_valid_time=3600 + apt: name={{ item }} state=present update_cache=yes with_items: - php7.0-fpm # for WordPress