summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/set_fact/incremental.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/set_fact/incremental.yml')
-rw-r--r--test/integration/targets/set_fact/incremental.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/integration/targets/set_fact/incremental.yml b/test/integration/targets/set_fact/incremental.yml
new file mode 100644
index 0000000..3f7aa6c
--- /dev/null
+++ b/test/integration/targets/set_fact/incremental.yml
@@ -0,0 +1,35 @@
+- name: test set_fact incremental https://github.com/ansible/ansible/issues/38271
+ hosts: testhost
+ gather_facts: no
+ tasks:
+ - name: Generate inline loop for set_fact
+ set_fact:
+ dig_list: "{{ dig_list + [ item ] }}"
+ loop:
+ - two
+ - three
+ - four
+ vars:
+ dig_list:
+ - one
+
+ - name: verify cumulative set fact worked
+ assert:
+ that:
+ - dig_list == ['one', 'two', 'three', 'four']
+
+ - name: Generate inline loop for set_fact (FQCN)
+ ansible.builtin.set_fact:
+ dig_list_fqcn: "{{ dig_list_fqcn + [ item ] }}"
+ loop:
+ - two
+ - three
+ - four
+ vars:
+ dig_list_fqcn:
+ - one
+
+ - name: verify cumulative set fact worked (FQCN)
+ assert:
+ that:
+ - dig_list_fqcn == ['one', 'two', 'three', 'four']