From 8a754e0858d922e955e71b253c139e071ecec432 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 18:04:21 +0200 Subject: Adding upstream version 2.14.3. Signed-off-by: Daniel Baumann --- test/integration/targets/debug/aliases | 2 ++ test/integration/targets/debug/main.yml | 6 ++++++ test/integration/targets/debug/main_fqcn.yml | 6 ++++++ test/integration/targets/debug/nosetfacts.yml | 21 +++++++++++++++++++++ test/integration/targets/debug/runme.sh | 20 ++++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 test/integration/targets/debug/aliases create mode 100644 test/integration/targets/debug/main.yml create mode 100644 test/integration/targets/debug/main_fqcn.yml create mode 100644 test/integration/targets/debug/nosetfacts.yml create mode 100755 test/integration/targets/debug/runme.sh (limited to 'test/integration/targets/debug') 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 "$@" -- cgit v1.2.3