Skip to content

Commit

Permalink
Pass package list directly to apt and yum modules without using with_…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Norman Bestfleisch committed Nov 2, 2018
1 parent b9acd71 commit eecd45e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tasks/apt.yml
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 1 addition & 3 deletions tasks/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit eecd45e

Please sign in to comment.