From c0f4da8a73a40cf3d4800acdc985fde7997ef6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 24 Jan 2023 09:33:17 +0100 Subject: [PATCH] Use flatten filter to install packages --- CHANGELOG.md | 4 ++++ defaults/main.yml | 2 +- tasks/main.yml | 4 +--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33accf7..b742b6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.0.2 + +### Fix +* Use flatten to manage packages list. ## v1.0.1 diff --git a/defaults/main.yml b/defaults/main.yml index 07399e1..62daecf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,7 +11,7 @@ # # List of base packages to install. deb_sec__required_packages: - - 'debsecan' + - debsecan # ]]] # .. envvar:: deb_sec__deploy_state [[[ # diff --git a/tasks/main.yml b/tasks/main.yml index f18fb5d..a24da74 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,12 +6,10 @@ # Manage required system packages [[[1 - name: Ensure required packages are in there desired state package: - name: '{{ item }}' + name: '{{ (deb_sec__required_packages | flatten) }}' state: '{{ "present" if (deb_sec__deploy_state == "present") else "absent" }}' install_recommends: False - with_flattened: - - '{{ deb_sec__required_packages | to_nice_json }}' register: pkg_result until: pkg_result is success