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

do not touch sysctl file to avoid idempotency problems #309

Merged
merged 1 commit into from
Sep 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/sysctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
owner: 'root'
group: 'root'
mode: '0440'
state: touch
state: file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will run into errors with this if the file does not exist (ansible file module errors out whenstate: file is used on a non-existent path). The proper way to fix idempotence is

state: touch
modification_time: preserve
access_time: preserve

https://docs.ansible.com/ansible/latest/modules/file_module.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is why it was touch, not file! Thanks! That's what happens if you don't document your code.

I'll fix thix.


- name: set Daemon umask, do config for rhel-family | NSA 2.2.4.1
template:
Expand Down