]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
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 7bcd63f8f2c39aa318d831592ff12f256a13a554..1fa104868a0ec398e3c15b21e51891cca74a9a95 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 62a2c678866d7fee403a308a297c01f43290732d..145066b874acd30ffcb29e18d495c3e190d22a89 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 0a890a9403be393f8d8cf76a5b9dbb66c7fecd6d..a71af822842992e87dde603bc325f69365dc3c94 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 3bfc39d66ce4e32a73e89bde19150c8cd20deba3..b84a240971e172254ab255d5973df5c2019acd79 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 4c6f6c0f608657f31d4f6b6d620ed79841c78251..199cf46d72388a18754a293ab0ee3ad50a7cc7f5 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 7a7cbd8b4987c347df8cc4743083671c95d06a32..acda775602f9e2339ac5375c2f4bc146ed248f83 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 031805b24ab40e0731d40d7d340abb4e12ba2fd9..5375bee9eeb1c262154c66bf0c8dd58ed6287502 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 081870bdcbb73309e7f79820276c356df517a2e2..4beb6392c4eb10f4024fc2970c2f597258d5c591 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 6f17f6247457fdaa97d1c88a5e52928a52d497b8..c3c7f9097f6aec0a9f86317f9a723c6f619c33e4 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 acd80dc5a100ae534595b5eebd20e83afe54933c..defacac2bec61b2d759b3e8112e07cdee5e09576 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 7c72f00e20fe72e2401f4d5f796bff71fd3849e4..a417ec4f1a4328ec729b6fc1feaab12de1ce5861 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 43370f625fd59a0d3e4a008f900ec4a02c2fe8bc..a70f6825ccd38673e9bb2a71d91cfe49d663afdd 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 3beeb553ade6655b8a110b03a6f2bfa19530f743..00e8239efdbdf7f0d4837ad43ed86d726c7f01d2 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 fa2dd38cc7346a3c94a11ddf49839338b1a86af2..a090ae794e48a56daa0264069b1d85d46c490aaa 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 d0ff78820bdb9efd1e5c76bf0b6f2139bffabf3d..7e11139097a4e41e6647936c98b7f97eea3e437f 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 f6499455bec49e61d8d5127720f69251ad8e8939..a8f8e46dc71eb7ee1af225448be6104caecb1daa 100644 (file)
@@ -6,6 +6,4 @@
     - packages
   apt: >
     state=present
-    name={{ item }}
-  with_items:
-    - xinetd
+    name=xinetd