-
Notifications
You must be signed in to change notification settings - Fork 85
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
Use ansible_facts to reference facts #132
Use ansible_facts to reference facts #132
Conversation
59762dd
to
f48cec5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown!
Please join in the conversation happening on the Discord Server as well.
f48cec5
to
790eecb
Compare
By default, Ansible injects a variable for every fact, prefixed with ansible_. This can result in a large number of variables for each host, which at scale can incur a performance penalty. Ansible provides a configuration option [0] that can be set to False to prevent this injection of facts. In this case, facts should be referenced via ansible_facts.. This change updates all references to Ansible facts from using individual fact variables to using the items in the ansible_facts dictionary. This allows users to disable fact variable injection in their Ansible configuration, which may provide some performance improvement. [0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars Signed-off-by: Will Szumski <[email protected]>
790eecb
to
52d62f5
Compare
Equivalent to: ansible-lockdown/RHEL9-CIS#54 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great update thank you
hi @jovial Thank you for taking the time to raise this PR and helping to improve ansible-lockdown. It does really help us to improve with feedback. Thank you uk-bolly |
Signed-off-by: Mark Bolwell <[email protected]>
hi @jovial Thank you again for you time, I have incorporated your changes into the community_work_fix branch with credits given as i need to try and get these fixes added as quickly as possible. many thanks uk-bolly |
hi @jovial Thanks again for taking the time to raise this PR. As mentioned we have managed to incorporate this into many other changes. With credit being given. many thanks once again uk-bolly |
Sorry, missed you comments. Thanks @uk-bolly - very much appreciated :) |
Overall Review of Changes:
By default, Ansible injects a variable for every fact, prefixed with
ansible_. This can result in a large number of variables for each host,
which at scale can incur a performance penalty. Ansible provides a
configuration option [0] that can be set to False to prevent this
injection of facts. In this case, facts should be referenced via
ansible_facts..
This change updates all references to Ansible facts from using
individual fact variables to using the items in the
ansible_facts dictionary. This allows users to disable fact variable
injection in their Ansible configuration, which may provide some
performance improvement.
[0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars
Issue Fixes:
No issue, but let me know if you want me to create one.
Enhancements:
How has this been tested?:
Ran the role against a host.