ansible/test/integration/targets/set_fact/runme.sh
Matt Martz 77d2008150
Don't perform string to bool conversion in set_fact when jinja2 native types is enabled (#43425)
* Don't perform string to bool conversion in set_fact when jinja2 native types is enabled. Fixes #42599

* Add tests for boolean conversions in set_fact
2018-07-30 15:44:38 -05:00

23 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -eux
MYTMPDIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
trap 'rm -rf "${MYTMPDIR}"' EXIT
# ensure we can incrementally set fact via loopi, injection or not
ANSIBLE_INJECT_FACT_VARS=0 ansible-playbook -i ../../inventory incremental.yml
ANSIBLE_INJECT_FACT_VARS=1 ansible-playbook -i ../../inventory incremental.yml
# ensure we dont have spurious warnings do to clean_facts
ansible-playbook -i ../../inventory nowarn_clean_facts.yml | grep '[WARNING]: Removed restricted key from module data: ansible_ssh_common_args' && exit 1
# test cached feature
export ANSIBLE_CACHE_PLUGIN=jsonfile ANSIBLE_CACHE_PLUGIN_CONNECTION="${MYTMPDIR}"
ansible-playbook -i ../../inventory "$@" set_fact_cached_1.yml
ansible-playbook -i ../../inventory "$@" set_fact_cached_2.yml
ansible-playbook -i ../../inventory --flush-cache "$@" set_fact_no_cache.yml
# Test boolean conversions in set_fact
ansible-playbook -v set_fact_bool_conv.yml
ANSIBLE_JINJA2_NATIVE=1 ansible-playbook -v set_fact_bool_conv_jinja2_native.yml