Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks contain duplicated and templated tags #296

Open
qwestduck opened this issue Aug 19, 2024 · 0 comments
Open

Tasks contain duplicated and templated tags #296

qwestduck opened this issue Aug 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@qwestduck
Copy link
Contributor

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 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.
@qwestduck qwestduck added the bug Something isn't working label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant