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
This commit is contained in:
Dmitriy Rabotyagov 2020-04-01 12:02:38 +03:00 committed by Dmitriy Rabotyagov (noonedeadpunk)
parent 53d65f4de4
commit e1d8ec2211

View File

@ -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