Remove with_items for package installs 64/15464/2
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 2 May 2019 11:28:45 +0000 (21:28 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 2 May 2019 11:28:45 +0000 (21:28 +1000)
Ansible supports lists passed to package install.
With this we can avoid using with_items since this makes
multiple calls to the packages manager slowing down
the performance.

Change-Id: Ieb09ed634533bcbbc60275aafd2c22b3d5c4086d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
provision/install-base-pkgs-Ubuntu.yaml
releasenotes/notes/remove-with-items-62e7f0682a338eb5.yaml [new file with mode: 0644]

index dc023e9..592568b 100644 (file)
@@ -1,14 +1,11 @@
 ---
 - name: Install base packages
   apt:
-    name: '{{pkg}}'
+    name:
+      - build-essential
+      - devscripts
+      - dh-systemd
+      - equivs
+      - gdebi
     state: latest
-  with_items:
-    - build-essential
-    - devscripts
-    - dh-systemd
-    - equivs
-    - gdebi
-  loop_control:
-    loop_var: pkg
   become: yes
diff --git a/releasenotes/notes/remove-with-items-62e7f0682a338eb5.yaml b/releasenotes/notes/remove-with-items-62e7f0682a338eb5.yaml
new file mode 100644 (file)
index 0000000..6e01892
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Ansible supports lists passed to package install that can avoid using
+    with_items. Using with_items makes multiple calls to the packages manager
+    slowing down the performance.