summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/debug
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/debug')
-rw-r--r--test/integration/targets/debug/aliases2
-rw-r--r--test/integration/targets/debug/main.yml6
-rw-r--r--test/integration/targets/debug/main_fqcn.yml6
-rw-r--r--test/integration/targets/debug/nosetfacts.yml21
-rwxr-xr-xtest/integration/targets/debug/runme.sh20
5 files changed, 55 insertions, 0 deletions
diff --git a/test/integration/targets/debug/aliases b/test/integration/targets/debug/aliases
new file mode 100644
index 0000000..1017932
--- /dev/null
+++ b/test/integration/targets/debug/aliases
@@ -0,0 +1,2 @@
+shippable/posix/group3
+context/controller # this is a controller-only action, the module is just for documentation
diff --git a/test/integration/targets/debug/main.yml b/test/integration/targets/debug/main.yml
new file mode 100644
index 0000000..9e49b82
--- /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 0000000..d6a00fc
--- /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 0000000..231c60e
--- /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 0000000..5faeb78
--- /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 "$@"