From e1d8ec221126a80b029bbd371b422e5ffe85fadd Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 1 Apr 2020 12:02:38 +0300 Subject: [PATCH] Fix role to work with Jinja 2.7 By default Centos is shipped with Jinja 2.7.2 which do not have `in` test. So we replace that logic with rejecting absent packages and suggest that the rest of statuses are valid for package installation. Change-Id: Ibeb3aba5cccddc1af1f968c57bdc0be75e7f22d9 --- tasks/rhel7stig/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/rhel7stig/packages.yml b/tasks/rhel7stig/packages.yml index 84ad3f37..e3bd6c14 100644 --- a/tasks/rhel7stig/packages.yml +++ b/tasks/rhel7stig/packages.yml @@ -18,7 +18,7 @@ name: "{{ stig_packages_rhel7 | selectattr('enabled') | selectattr('state', 'equalto', item) | sum(attribute='packages', start=[]) }}" state: "{{ item }}" with_items: - - "{{ stig_packages_rhel7 | selectattr('enabled') | selectattr('state', 'in', ['present', 'latest']) | map(attribute='state') | unique | list }}" + - "{{ stig_packages_rhel7 | selectattr('enabled') | rejectattr('state', 'equalto', 'absent') | map(attribute='state') | unique | list }}" tags: - cat1 - auth