From 1cb0f11add7a8494b6b22f4d55a5ab3f7b1ee3cd Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 2 May 2019 21:28:45 +1000 Subject: [PATCH] Remove with_items for package installs 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 --- provision/install-base-pkgs-Ubuntu.yaml | 15 ++++++--------- .../notes/remove-with-items-62e7f0682a338eb5.yaml | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/remove-with-items-62e7f0682a338eb5.yaml diff --git a/provision/install-base-pkgs-Ubuntu.yaml b/provision/install-base-pkgs-Ubuntu.yaml index dc023e9..592568b 100644 --- a/provision/install-base-pkgs-Ubuntu.yaml +++ b/provision/install-base-pkgs-Ubuntu.yaml @@ -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 index 0000000..6e01892 --- /dev/null +++ b/releasenotes/notes/remove-with-items-62e7f0682a338eb5.yaml @@ -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. -- 2.16.6