From 00ad3500c87f29c7809d12881776774281e8caf9 Mon Sep 17 00:00:00 2001 From: Logan V Date: Fri, 15 Mar 2019 22:58:29 -0500 Subject: [PATCH] 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 --- tasks/rhel7stig/misc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/rhel7stig/misc.yml b/tasks/rhel7stig/misc.yml index a558dd98..6e1179b7 100644 --- a/tasks/rhel7stig/misc.yml +++ b/tasks/rhel7stig/misc.yml @@ -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