Update "apt" tasks to use lists
authorAlexander Barton <alex@barton.de>
Thu, 18 Oct 2018 16:32:15 +0000 (18:32 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 18 Oct 2018 16:32:15 +0000 (18:32 +0200)
This fixes the following deprecation warning:

'Invoking "apt" only once while using a loop via squash_actions is
deprecated. Instead of using a loop to supply multiple items and
specifying `name: {{ item }}`'

16 files changed:
roles/apache2-php5/tasks/main.yml
roles/apache2-php7/tasks/main.yml
roles/apache2/tasks/main.yml
roles/check-mk-agent/tasks/main.yml
roles/debian-base/tasks/main.yml
roles/docker-engine/tasks/main.yml
roles/git-backup-script/tasks/main.yml
roles/kexec/tasks/main.yml
roles/lcmc-cluster-node/tasks/main.yml
roles/mysql-server/tasks/main.yml
roles/nodejs/tasks/main.yml
roles/ntpd/tasks/main.yml
roles/piwik/tasks/main.yml
roles/postgresql-server/tasks/main.yml
roles/ubuntu-base/tasks/main.yml
roles/xinetd/tasks/main.yml

index 7bcd63f..1fa1048 100644 (file)
   tags:
     - apache
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - libapache2-mod-php5
-    - php5
-    - php5-cli
-    - php5-mysql
+  apt:
+    statepresent
+    name: [
+      'libapache2-mod-php5',
+      'php5',
+      'php5-cli',
+      'php5-mysql',
+    ]
   notify:
     - restart "apache2"
 
index 62a2c67..145066b 100644 (file)
@@ -5,15 +5,15 @@
   tags:
     - apache
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - libapache2-mod-php
-    - php
-    - php-cli
-    - php-mysql
-    - php-pgsql
+  apt:
+    statepresent
+    name: [
+      'libapache2-mod-php',
+      'php',
+      'php-cli',
+      'php-mysql',
+      'php-pgsql',
+    ]
   notify:
     - restart "apache2"
 
index 0a890a9..a71af82 100644 (file)
@@ -5,13 +5,13 @@
   tags:
     - apache
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - apache2
-    - apache2-utils
-    - apachetop
+  apt:
+    statepresent
+    name: [
+      'apache2',
+      'apache2-utils',
+      'apachetop',
+    ]
   notify:
     - restart "apache2"
 
index 3bfc39d..b84a240 100644 (file)
@@ -6,12 +6,12 @@
     - check_mk
     - monitoring
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - check-mk-agent
-    - nagios-plugins-basic
+  apt:
+    statepresent
+    name: [
+      'check-mk-agent',
+      'nagios-plugins-basic',
+    ]
 
 - name: install Debian packages for Check_MK agent (2/2)
   tags:
index 4c6f6c0..199cf46 100644 (file)
@@ -4,35 +4,33 @@
 - name: install common packages
   tags:
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - bash-completion
-    - ca-certificates
-    - curl
-    - debconf-utils
-    - etckeeper
-    - git
-    - htop
-    - less
-    - lsb-base
-    - lsb-release
-    - psmisc
-    - net-tools
-    - screen
-    - sudo
-    - telnet-ssl
-    - vim
+  apt:
+    statepresent
+    name: [
+      'bash-completion',
+      'ca-certificates',
+      'curl',
+      'debconf-utils',
+      'etckeeper',
+      'git',
+      'htop',
+      'less',
+      'lsb-base',
+      'lsb-release',
+      'psmisc',
+      'net-tools',
+      'screen',
+      'sudo',
+      'telnet-ssl',
+      'vim',
+    ]
 
 - name: install common packages (non Proxmox-VE hosts)
   tags:
     - packages
   apt: >
     state=present
-    name={{ item }}
-  with_items:
-    - busybox-static
+    name=busybox-static
   when: "ansible_kernel.find('pve') < 1"
 
 - name: install Linux kernel packages (amd64; non Proxmox-VE hosts, non OpenVZ guest)
index 7a7cbd8..acda775 100644 (file)
@@ -5,12 +5,12 @@
   tags:
     - docker
     - packages
-  apt: >
-    name={{ item }}
-    state=present
-  with_items:
-    - apt-transport-https
-    - ca-certificates
+  apt:
+    name: [
+      'apt-transport-https',
+      'ca-certificates',
+    ]
+    state: present
   when: docker_apt_repository.startswith("https://")
 
 - name: install docker.io repository GnuPG key
index 031805b..5375bee 100644 (file)
@@ -4,12 +4,12 @@
 - name: install "rsync" and "make"
   tags:
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - rsync
-    - make
+  apt:
+    statepresent
+    name: [
+      'rsync',
+      'make',
+    ]
 
 - name: clone "backup-script" GIT repository
   tags:
index 081870b..4beb639 100644 (file)
@@ -7,9 +7,7 @@
     - kexec
   apt: >
     state=present
-    name={{ item }}
-  with_items:
-    - kexec-tools
+    name=kexec-tools
 
 - name: configure kexec tools
   tags:
index 6f17f62..c3c7f90 100644 (file)
@@ -4,10 +4,10 @@
 - name: install packages for cluster nodes
   tags:
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - drbd8-utils
-    - pacemaker
-    - corosync
+  apt:
+    statepresent
+    name: [
+      'drbd8-utils',
+      'pacemaker',
+      'corosync',
+    ]
index acd80dc..defacac 100644 (file)
     - mysql
     - mysqld
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - mysql-client
-    - mysql-server
-    - mysqltuner
-    - python-mysqldb
+  apt:
+    statepresent
+    name: [
+      'mysql-client',
+      'mysql-server',
+      'mysqltuner',
+      'python-mysqldb',
+    ]
 
 - name: ensure service "mysql" is enabled and started
   tags:
index 7c72f00..a417ec4 100644 (file)
@@ -6,11 +6,11 @@
     - nodejs
     - packages
   apt:
-    name: "{{ item }}"
+    name: [
+      'apt-transport-https',
+      'ca-certificates',
+    ]
     state: present
-  with_items:
-    - apt-transport-https
-    - ca-certificates
   when: nodejs_apt_repository.startswith("https://")
 
 - name: install Node.js repository GnuPG key
index 43370f6..a70f682 100644 (file)
   tags:
     - ntpd
     - packages
-  apt: >
-    name={{ item }}
-    state=present
-  with_items:
-    - ntpdate
-    - ntp
+  apt:
+    name: [
+      'ntpdate',
+      'ntp',
+    ]
+    state: present
 
 - name: ensure service "ntp" is enabled and started
   tags:
index 3beeb55..00e8239 100644 (file)
@@ -5,12 +5,12 @@
   tags:
     - docker
     - packages
-  apt: >
-    name={{ item }}
-    state=present
-  with_items:
-    - apt-transport-https
-    - ca-certificates
+  apt:
+    name: [
+      'apt-transport-https',
+      'ca-certificates',
+    ]
+    state: present
   when: piwik_apt_repository.startswith("https://")
 
 - name: install Piwik repository GnuPG key
index fa2dd38..a090ae7 100644 (file)
@@ -20,9 +20,7 @@
     - postgresql
   apt: >
     state=present
-    name={{ item }}
-  with_items:
-    - postgresql-{{ postgresql_major }}
+    name=postgresql-{{ postgresql_major }}
 
 - name: ensure service "postgresql" is enabled and started
   tags:
index d0ff788..7e11139 100644 (file)
@@ -4,25 +4,25 @@
 - name: install common packages
   tags:
     - packages
-  apt: >
-    state=present
-    name={{ item }}
-  with_items:
-    - bash-completion
-    - busybox-static
-    - ca-certificates
-    - curl
-    - debconf-utils
-    - etckeeper
-    - git
-    - htop
-    - less
-    - linux-image-generic
-    - lsb-base
-    - lsb-release
-    - psmisc
-    - net-tools
-    - screen
-    - sudo
-    - telnet-ssl
-    - vim
+  apt:
+    statepresent
+    name: [
+      'bash-completion',
+      'busybox-static',
+      'ca-certificates',
+      'curl',
+      'debconf-utils',
+      'etckeeper',
+      'git',
+      'htop',
+      'less',
+      'linux-image-generic',
+      'lsb-base',
+      'lsb-release',
+      'psmisc',
+      'net-tools',
+      'screen',
+      'sudo',
+      'telnet-ssl',
+      'vim',
+    ]
index f649945..a8f8e46 100644 (file)
@@ -6,6 +6,4 @@
     - packages
   apt: >
     state=present
-    name={{ item }}
-  with_items:
-    - xinetd
+    name=xinetd