From 180eea8089dd74dbb9c4a842074d4f12c22550c1 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Thu, 23 Jul 2020 13:09:58 -0400 Subject: [PATCH] Update default from True to False for CONDITIONAL_BARE_VARS (#70709) (#70838) ci_complete (cherry picked from commit 2811d9486fe2777c640c29b7b247d6a1b75dd96e) --- .../fragments/update-conditionals-bare-vars-default.yml | 2 ++ lib/ansible/config/base.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/update-conditionals-bare-vars-default.yml diff --git a/changelogs/fragments/update-conditionals-bare-vars-default.yml b/changelogs/fragments/update-conditionals-bare-vars-default.yml new file mode 100644 index 00000000000..241ec821270 --- /dev/null +++ b/changelogs/fragments/update-conditionals-bare-vars-default.yml @@ -0,0 +1,2 @@ +minor_changes: + - conditionals - change the default of CONDITIONAL_BARE_VARS to False (https://github.com/ansible/ansible/issues/70682). diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 5c1d010b15f..525efa26e89 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -366,14 +366,14 @@ COLOR_WARN: - {key: warn, section: colors} CONDITIONAL_BARE_VARS: name: Allow bare variable evaluation in conditionals - default: True + default: False type: boolean description: - With this setting on (True), running conditional evaluation 'var' is treated differently than 'var.subkey' as the first is evaluated directly while the second goes through the Jinja2 parser. But 'false' strings in 'var' get evaluated as booleans. - With this setting off they both evaluate the same but in cases in which 'var' was 'false' (a string) it won't get evaluated as a boolean anymore. - Currently this setting defaults to 'True' but will soon change to 'False' and the setting itself will be removed in the future. - - Expect the default to change in version 2.10 and that this setting eventually will be deprecated after 2.12 + - Expect that this setting eventually will be deprecated after 2.12 env: [{name: ANSIBLE_CONDITIONAL_BARE_VARS}] ini: - {key: conditional_bare_variables, section: defaults}