From c8b25d2014702151e02d26de9883f5ed1d91322f Mon Sep 17 00:00:00 2001 From: Norman Bestfleisch Date: Fri, 2 Nov 2018 09:10:24 +0100 Subject: [PATCH] Pass package list directly to apt and yum modules without using with_items loop Invoking "apt" or "yum" only once while using a loop via squash_actions is deprecated. This commit removes the with_items loops to prevent the deprecation warning. Signed-off-by: Norman Bestfleisch --- tasks/apt.yml | 4 +--- tasks/yum.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tasks/apt.yml b/tasks/apt.yml index b3ceff3e..ee994403 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -1,8 +1,6 @@ --- - name: remove deprecated or insecure packages | package-01 - package-09 apt: - name: '{{ item }}' + name: '{{ os_security_packages_list }}' state: 'absent' - with_items: - - '{{ os_security_packages_list }}' when: 'os_security_packages_clean' diff --git a/tasks/yum.yml b/tasks/yum.yml index 2f4000f7..f16f233d 100644 --- a/tasks/yum.yml +++ b/tasks/yum.yml @@ -40,8 +40,6 @@ - name: remove deprecated or insecure packages | package-01 - package-09 yum: - name: '{{ item }}' + name: '{{ os_security_packages_list }}' state: 'absent' - with_items: - - '{{ os_security_packages_list }}' when: os_security_packages_clean