Fix conditional cast to bool

While running the hardening role, I found that a small VM would
regularly crash ansible on the chrony configuration templating
task with "A worker was found in a dead state!". An ansible bug[0]
shows that this can be caused by jinja templating that is not casted
to the correct type.

After verifying the crash was reproducible 3-4 times in a row, this
crash stopped occuring once I started casting this variable to a bool.

I don't know if it is coincidence but it can't hurt to cast this
conditional regardless.

[0] https://github.com/ansible/ansible/issues/32554#issuecomment-382360908

Change-Id: Ie34de1808c807fd31099cc7d3d7b140ccfab64df
This commit is contained in:
Logan V 2019-03-15 22:58:29 -05:00
parent ef1b417032
commit 00ad3500c8
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@
src: chrony.conf.j2
dest: "{{ chrony_conf_file }}"
when:
- chrony_conf_check.stat.exists
- chrony_conf_check.stat.exists | bool
- security_rhel7_enable_chrony | bool
notify:
- restart chrony