Procházet zdrojové kódy

Remove update_cache=yes while installing packages to improve performances

Emmanuel Bouthenot před 7 roky
rodič
revize
6841a74b53

+ 3 - 3
roles/common/tasks/base.yml

@@ -46,7 +46,7 @@
   when: apt_repositories
 
 - name: 'Install base packages'
-  apt: pkg={{ item }} install_recommends=no state=installed update_cache=yes
+  apt: pkg={{ item }} install_recommends=no state=installed
   with_items:
     - 'apticron'
     - 'locales-all'
@@ -74,12 +74,12 @@
     - 'ncdu'
 
 - name: 'Install additional packages'
-  apt: pkg={{ item }} install_recommends=no state=installed update_cache=yes
+  apt: pkg={{ item }} install_recommends=no state=installed
   with_items: '{{ apt_additional_packages }}'
   when: apt_additional_packages
 
 - name: 'Install ntp daemon'
-  apt: pkg=ntp install_recommends=no state=installed update_cache=yes
+  apt: pkg=ntp install_recommends=no state=installed
   when: with_ntp
 
 - name: 'Configure default locale and timezone'

+ 0 - 1
roles/common/tasks/dkim.yml

@@ -3,7 +3,6 @@
     pkg: '{{ item }}'
     install_recommends: 'no'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'opendkim'
 

+ 1 - 1
roles/common/tasks/dns.yml

@@ -5,7 +5,7 @@
   when: with_dnscache
 
 - name: Install unbound (dnscache) packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - unbound
   when: with_dnscache

+ 0 - 1
roles/common/tasks/firewall.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: '{{ item }}'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'linux-image-{{ facter_architecture }}'
     - 'ferm'

+ 0 - 3
roles/common/tasks/security.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: 'unattended-upgrades'
     state: 'installed'
-    update_cache: 'yes'
   when: with_auto_upgrade
 
 - name: 'Reconfigure unattended-upgrades package'
@@ -31,7 +30,6 @@
   apt:
     pkg: '{{ item }}'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'logcheck'
     - 'logcheck-database'
@@ -94,7 +92,6 @@
   apt:
     pkg: '{{ item }}'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'lsof'
     - 'unhide'

+ 1 - 1
roles/common/tasks/smartd.yml

@@ -1,5 +1,5 @@
 - name: Install smartmontools package
-  apt: pkg=smartmontools state=installed update_cache=yes
+  apt: pkg=smartmontools state=installed
 
 - name: Install smartd configuration
   template: src=smartd/smartd.conf.j2 dest=/etc/smartd.conf owner=root group=root mode=0644

+ 0 - 1
roles/common/tasks/smtp.yml

@@ -3,7 +3,6 @@
     pkg: '{{ item }}'
     install_recommends: 'no'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'postfix'
     - 'ca-certificates'

+ 1 - 1
roles/common/tasks/ssh.yml

@@ -1,5 +1,5 @@
 - name: Install ssh packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - openssh-server
     - openssh-client

+ 3 - 3
roles/dbserver/tasks/mysql.yml

@@ -1,19 +1,19 @@
 - name: Install MySQL server related packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - mysql-server
     - mysql-client
   when: with_mysql
 
 - name: Install MariaDB server related packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - mariadb-server
     - mariadb-client
   when: with_mariadb
 
 - name: Install MySQL or MariaDB backup related packages (automysqlbackup)
-  apt: pkg=automysqlbackup state=installed update_cache=yes
+  apt: pkg=automysqlbackup state=installed
   when: with_mysql_backup
 
 - name: Fix automysqlbackup to handle events properly

+ 2 - 2
roles/dbserver/tasks/postgresql.yml

@@ -1,11 +1,11 @@
 - name: Install PostgreSQL server related packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - postgresql
     - postgresql-client
 
 - name: Install PostgreSQL backup related packages (autopostgresqlbackup)
-  apt: pkg=autopostgresqlbackup state=installed update_cache=yes
+  apt: pkg=autopostgresqlbackup state=installed
   when: with_postgresql_backup
 
 - name: Ensure PostgreSQL server is running

+ 0 - 1
roles/ftpserver/tasks/pure-ftpd.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: '{{ item }}'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'pure-ftpd'
 

+ 0 - 1
roles/hypervisor/tasks/ganeti.yml

@@ -3,7 +3,6 @@
     pkg: '{{ item }}'
     install_recommends: 'no'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'ganeti'
     - 'ganeti-instance-debootstrap'

+ 0 - 1
roles/hypervisor/tasks/xen.yml

@@ -3,7 +3,6 @@
     pkg: '{{ item }}'
     install_recommends: 'no'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'xen-linux-system-amd64'
     - 'bridge-utils'

+ 1 - 1
roles/monitoring/tasks/mon.yml

@@ -1,5 +1,5 @@
 - name: Install mon packages
-  apt: pkg=mon state=installed update_cache=yes
+  apt: pkg=mon state=installed
 
 - name: Create need directory for mon configuration
   file: path=/etc/mon/mon.d state=directory owner=root group=root mode=0755

+ 2 - 2
roles/monitoring/tasks/munin.yml

@@ -1,5 +1,5 @@
 - name: Install munin packages
-  apt: pkg=munin state=installed update_cache=yes
+  apt: pkg=munin state=installed
   when: with_munin
 
 - name: Install munin configuration
@@ -7,7 +7,7 @@
   when: with_munin
 
 - name: Install munin-node packages
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - munin-node
     - munin-plugins-extra

+ 0 - 1
roles/monitoring/tasks/zabbix.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: '{{ item }}'
     state: 'installed'
-    update_cache: 'yes'
   with_items:
     - 'zabbix-agent'
 

+ 0 - 1
roles/webserver/tasks/apache2.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: 'apache2'
     state: 'installed'
-    update_cache: 'yes'
 
 - name: 'Install logrotate configuration for Apache'
   template:

+ 0 - 1
roles/webserver/tasks/nginx.yml

@@ -2,7 +2,6 @@
   apt:
     pkg: 'nginx'
     state: 'installed'
-    update_cache: 'yes'
 
 - name: 'Install logrotate configuration for nginx'
   template:

+ 8 - 8
roles/webserver/tasks/php.yml

@@ -1,5 +1,5 @@
 - name: Install common PHP dependencies
-  apt: pkg={{ item }} state=installed update_cache=yes
+  apt: pkg={{ item }} state=installed
   with_items:
     - php5-cli
     - php5-curl
@@ -28,7 +28,7 @@
   when: with_php and ansible_lsb.major_release|int >= 8
 
 - name: Install mod_php5 packages for apache2
-  apt: pkg=libapache2-mod-php5 state=installed update_cache=yes
+  apt: pkg=libapache2-mod-php5 state=installed
   when: with_modphp5
 
 - name: Install local PHP configuration (Debian < 8)
@@ -46,7 +46,7 @@
   template: src=php/phpinfo.php dest=/etc/php5/syscheck.d/index.php owner=root group=root mode=0644
 
 - name: Install PHP APC extension
-  apt: pkg=php-apc state=installed update_cache=yes
+  apt: pkg=php-apc state=installed
   when: with_php_apc
 
 - name: Install php-apc system check
@@ -54,23 +54,23 @@
   when: with_php_apc
 
 - name: Install MySQL extension for PHP (native driver)
-  apt: pkg=php5-mysqlnd state=installed update_cache=yes
+  apt: pkg=php5-mysqlnd state=installed
   when: not with_php_mysql_legacy
 
 - name: Install MySQL extension for PHP (old driver)
-  apt: pkg=php5-mysql state=installed update_cache=yes
+  apt: pkg=php5-mysql state=installed
   when: with_php_mysql_legacy
 
 - name: Install PHPMyAdmin
-  apt: pkg=phpmyadmin state=installed update_cache=yes
+  apt: pkg=phpmyadmin state=installed
   when: with_phpmyadmin
 
 - name: Install PHPPgAdmin
-  apt: pkg=phppgadmin state=installed update_cache=yes
+  apt: pkg=phppgadmin state=installed
   when: with_phppgadmin
 
 - name: Install php5-fpm package
-  apt: pkg=php5-fpm state=installed update_cache=yes
+  apt: pkg=php5-fpm state=installed
   when: with_fpm
 
 - name: Install php5-fpm init script config file