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/lookup_together/aliases | 1 + .../targets/lookup_together/tasks/main.yml | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/integration/targets/lookup_together/aliases create mode 100644 test/integration/targets/lookup_together/tasks/main.yml (limited to 'test/integration/targets/lookup_together') diff --git a/test/integration/targets/lookup_together/aliases b/test/integration/targets/lookup_together/aliases new file mode 100644 index 0000000..3005e4b --- /dev/null +++ b/test/integration/targets/lookup_together/aliases @@ -0,0 +1 @@ +shippable/posix/group4 diff --git a/test/integration/targets/lookup_together/tasks/main.yml b/test/integration/targets/lookup_together/tasks/main.yml new file mode 100644 index 0000000..71365a1 --- /dev/null +++ b/test/integration/targets/lookup_together/tasks/main.yml @@ -0,0 +1,29 @@ +- name: test with_together + #shell: echo {{ item }} + set_fact: "{{ item.0 }}={{ item.1 }}" + with_together: + - [ 'a', 'b', 'c', 'd' ] + - [ '1', '2', '3', '4' ] + +- name: verify with_together results + assert: + that: + - "a == '1'" + - "b == '2'" + - "c == '3'" + - "d == '4'" + +- block: + - name: "EXPECTED FAILURE - test empty list" + debug: + msg: "{{ item.0 }} and {{ item.1 }}" + with_together: [] + + - fail: + msg: "should not get here" + + rescue: + - assert: + that: + - ansible_failed_task.name == "EXPECTED FAILURE - test empty list" + - ansible_failed_result.msg == "with_together requires at least one element in each list" \ No newline at end of file -- cgit v1.2.3