mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Switch set_fact test to private inventory.
Fixes a test failure when there is no explicit localhost in inventory.
This commit is contained in:
parent
6a0452559b
commit
bca50b47ed
2 changed files with 9 additions and 6 deletions
3
test/integration/targets/set_fact/inventory
Normal file
3
test/integration/targets/set_fact/inventory
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[testgroup]
|
||||||
|
testhost ansible_connection=local
|
||||||
|
localhost
|
|
@ -6,17 +6,17 @@ MYTMPDIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
|
||||||
trap 'rm -rf "${MYTMPDIR}"' EXIT
|
trap 'rm -rf "${MYTMPDIR}"' EXIT
|
||||||
|
|
||||||
# ensure we can incrementally set fact via loopi, injection or not
|
# 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=0 ansible-playbook -i inventory incremental.yml
|
||||||
ANSIBLE_INJECT_FACT_VARS=1 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
|
# 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
|
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
|
# test cached feature
|
||||||
export ANSIBLE_CACHE_PLUGIN=jsonfile ANSIBLE_CACHE_PLUGIN_CONNECTION="${MYTMPDIR}"
|
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_1.yml
|
||||||
ansible-playbook -i ../../inventory "$@" set_fact_cached_2.yml
|
ansible-playbook -i inventory "$@" set_fact_cached_2.yml
|
||||||
ansible-playbook -i ../../inventory --flush-cache "$@" set_fact_no_cache.yml
|
ansible-playbook -i inventory --flush-cache "$@" set_fact_no_cache.yml
|
||||||
|
|
||||||
# Test boolean conversions in set_fact
|
# Test boolean conversions in set_fact
|
||||||
ansible-playbook -v set_fact_bool_conv.yml
|
ansible-playbook -v set_fact_bool_conv.yml
|
||||||
|
|
Loading…
Reference in a new issue