From 5394cedc2a2d72b4a5d22f523df6dd53961a0f52 Mon Sep 17 00:00:00 2001 From: Julien Viard de Galbert Date: Tue, 7 May 2019 00:00:48 +0200 Subject: [PATCH] Fix deprecation warning with ansible 2.7 [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 }}"`, please use `name: ['{{ nft_old_pkg_list }}']` and remove the loop. This feature will be removed in version 2.11. Signed-off-by: Julien Viard de Galbert --- CHANGELOG.md | 4 ++++ tasks/main.yml | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 552304e..4ff41c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Clean tasks name and comments in tasks/main.yml file. * Order and clean comments in defaults/main.yml file. +### Fix +* Fix deprecation warning with ansible 2.7: Invoking "apt" only once while + using a loop via squash_actions is deprecated. + ## v1.5.0 ### Enhancements diff --git a/tasks/main.yml b/tasks/main.yml index 8b4c93b..0e76bfd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,20 +13,16 @@ # Manage packages [[[1 - name: Ensure Nftables packages are in there desired state package: - name: '{{ item }}' + name: '{{ nft_pkg_list | list }}' state: '{{ nft_pkg_state }}' - with_items: - - '{{ nft_pkg_list | to_nice_json }}' register: pkg_install_result until: pkg_install_result is success when: nft_enabled|bool - name: Ensure old Iptables packages are in there desired state apt: - name: '{{ item }}' + name: '{{ nft_old_pkg_list | list }}' state: '{{ nft_old_pkg_state }}' - with_items: - - '{{ nft_old_pkg_list | to_nice_json }}' register: pkg_remove_result until: pkg_remove_result is success when: (nft_enabled|bool and