Tasks contain duplicated and templated tags. Duplicated tags are a cosmetic nitpick that are easy to address while removing templated tags.
Templated tags are more problematic. Tags templated from role default vars have not worked since ansible-core 2.15 when using ANSIBLE_PRIVATE_ROLE_VARS=True. This is an issue that I am actively working on and further details are likely out of scope for this project.
It is easy enough to avoid templated tags entirely as a workaround since there is only one such tag: "{{ rhel8stig_firewall_service }}".
ANSIBLE_PRIVATE_ROLE_VARS=True ansible-playbook -i inventory site.yml fails with an error similar to rhel8stig_firewall_service: undefined value.
Control(s) Affected
RHEL-08-040100
Environment
branch being used: [devel]
Ansible Version: [2.16]
Host Python Version: [Python 3.12.3]
Ansible Server Python Version: [Python 3.12.3]
Additional Notes
This is likely the cause of #213 .
Possible Solution
Remove all extra copies of duplicated tags.
Replace "{{ rhel8stig_firewall_service }}" with static strings representing values that can cause change in the block. Those values are "firewalld" and "iptables". The third value used elsewhere to fill this template, "not_required" has not effect because of guards in the block.
Add ansible-lint rules to assert these two conditions are resolved and prevent future reintroduction.
Describe the Issue
Tasks contain duplicated and templated tags. Duplicated tags are a cosmetic nitpick that are easy to address while removing templated tags.
Templated tags are more problematic. Tags templated from role default vars have not worked since ansible-core 2.15 when using ANSIBLE_PRIVATE_ROLE_VARS=True. This is an issue that I am actively working on and further details are likely out of scope for this project.
It is easy enough to avoid templated tags entirely as a workaround since there is only one such tag: "{{ rhel8stig_firewall_service }}".
Expected Behavior
ANSIBLE_PRIVATE_ROLE_VARS=True ansible-playbook -i inventory site.yml
succeeds.Actual Behavior
ANSIBLE_PRIVATE_ROLE_VARS=True ansible-playbook -i inventory site.yml
fails with an error similar torhel8stig_firewall_service: undefined value
.Control(s) Affected
RHEL-08-040100
Environment
Additional Notes
This is likely the cause of #213 .
Possible Solution