diff options
Diffstat (limited to 'test/integration/targets/debug')
-rw-r--r-- | test/integration/targets/debug/aliases | 1 | ||||
-rw-r--r-- | test/integration/targets/debug/main.yml | 6 | ||||
-rw-r--r-- | test/integration/targets/debug/main_fqcn.yml | 6 | ||||
-rw-r--r-- | test/integration/targets/debug/nosetfacts.yml | 21 | ||||
-rwxr-xr-x | test/integration/targets/debug/runme.sh | 20 |
5 files changed, 54 insertions, 0 deletions
diff --git a/test/integration/targets/debug/aliases b/test/integration/targets/debug/aliases new file mode 100644 index 00000000..a6dafcf8 --- /dev/null +++ b/test/integration/targets/debug/aliases @@ -0,0 +1 @@ +shippable/posix/group1 diff --git a/test/integration/targets/debug/main.yml b/test/integration/targets/debug/main.yml new file mode 100644 index 00000000..9e49b827 --- /dev/null +++ b/test/integration/targets/debug/main.yml @@ -0,0 +1,6 @@ +- hosts: localhost + gather_facts: no + tasks: + - name: test item being present in the output + debug: var=item + loop: [1, 2, 3] diff --git a/test/integration/targets/debug/main_fqcn.yml b/test/integration/targets/debug/main_fqcn.yml new file mode 100644 index 00000000..d6a00fc8 --- /dev/null +++ b/test/integration/targets/debug/main_fqcn.yml @@ -0,0 +1,6 @@ +- hosts: localhost + gather_facts: no + tasks: + - name: test item being present in the output + ansible.builtin.debug: var=item + loop: [1, 2, 3] diff --git a/test/integration/targets/debug/nosetfacts.yml b/test/integration/targets/debug/nosetfacts.yml new file mode 100644 index 00000000..231c60e4 --- /dev/null +++ b/test/integration/targets/debug/nosetfacts.yml @@ -0,0 +1,21 @@ +- name: check we dont set facts with debug ansible_facts https://github.com/ansible/ansible/issues/74060 + hosts: localhost + gather_facts: false + tasks: + - name: create namespaced non fact + set_fact: + ansible_facts: + nonfact: 1 + + - name: ensure nonfact does not exist + assert: + that: + - nonfact is not defined + + - name: debug ansible_facts to create issue + debug: var=ansible_facts + + - name: ensure nonfact STILL does not exist + assert: + that: + - nonfact is not defined diff --git a/test/integration/targets/debug/runme.sh b/test/integration/targets/debug/runme.sh new file mode 100755 index 00000000..5faeb782 --- /dev/null +++ b/test/integration/targets/debug/runme.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -eux + +trap 'rm -f out' EXIT + +ansible-playbook main.yml -i ../../inventory | tee out +for i in 1 2 3; do + grep "ok: \[localhost\] => (item=$i)" out + grep "\"item\": $i" out +done + +ansible-playbook main_fqcn.yml -i ../../inventory | tee out +for i in 1 2 3; do + grep "ok: \[localhost\] => (item=$i)" out + grep "\"item\": $i" out +done + +# ensure debug does not set top level vars when looking at ansible_facts +ansible-playbook nosetfacts.yml "$@" |