From ccf0df9f91f1ae358abaeb57124eb77fd5c9a336 Mon Sep 17 00:00:00 2001 From: Gael Chamoulaud Date: Wed, 5 Apr 2017 16:45:15 +0200 Subject: [PATCH] Fix unqualified Ansible boolean variables When using boolean variables in conditional tests, those variables should be filtered as '|bool'. Otherwise, they are being evaluated as a string and return True in any case. Change-Id: I591d49cfd242d9b404de9fe616c08008fa626764 Signed-off-by: Gael Chamoulaud --- roles/convert-image/templates/convert_image.sh.j2 | 4 ++-- roles/libvirt/setup/overcloud/templates/baremetalvm.xml.j2 | 2 +- roles/libvirt/setup/undercloud/templates/undercloudvm.xml.j2 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/convert-image/templates/convert_image.sh.j2 b/roles/convert-image/templates/convert_image.sh.j2 index 5944c7b70..2f0c75dec 100644 --- a/roles/convert-image/templates/convert_image.sh.j2 +++ b/roles/convert-image/templates/convert_image.sh.j2 @@ -13,7 +13,7 @@ else exit 1 fi -{% if not undercloud_setup %} +{% if not undercloud_setup|bool %} yum update -y @@ -50,7 +50,7 @@ chmod 600 /swapfile # Enable it on start echo "/swapfile swap swap defaults 0 0" >> /etc/fstab -{% if not selinux_enforcing %} +{% if not selinux_enforcing|bool %} sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config diff --git a/roles/libvirt/setup/overcloud/templates/baremetalvm.xml.j2 b/roles/libvirt/setup/overcloud/templates/baremetalvm.xml.j2 index d3b40a507..ab27083fb 100644 --- a/roles/libvirt/setup/overcloud/templates/baremetalvm.xml.j2 +++ b/roles/libvirt/setup/overcloud/templates/baremetalvm.xml.j2 @@ -36,7 +36,7 @@ -{% if enable_vnc_console %} +{% if enable_vnc_console|bool %}