summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/templating_lookups/template_lookup_vaulted
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/templating_lookups/template_lookup_vaulted')
-rw-r--r--test/integration/targets/templating_lookups/template_lookup_vaulted/playbook.yml13
-rw-r--r--test/integration/targets/templating_lookups/template_lookup_vaulted/templates/vaulted_hello.j26
-rw-r--r--test/integration/targets/templating_lookups/template_lookup_vaulted/test_vault_pass1
3 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/templating_lookups/template_lookup_vaulted/playbook.yml b/test/integration/targets/templating_lookups/template_lookup_vaulted/playbook.yml
new file mode 100644
index 0000000..23f32e8
--- /dev/null
+++ b/test/integration/targets/templating_lookups/template_lookup_vaulted/playbook.yml
@@ -0,0 +1,13 @@
+# https://github.com/ansible/ansible/issues/34209
+- hosts: localhost
+ gather_facts: no
+ vars:
+ hello_world: Hello World
+ tasks:
+ - name: Test that template lookup can handle vaulted templates
+ set_fact:
+ vaulted_hello_world: "{{ lookup('template', 'vaulted_hello.j2') }}"
+
+ - assert:
+ that:
+ - "vaulted_hello_world|trim == 'Unvaulted Hello World!'"
diff --git a/test/integration/targets/templating_lookups/template_lookup_vaulted/templates/vaulted_hello.j2 b/test/integration/targets/templating_lookups/template_lookup_vaulted/templates/vaulted_hello.j2
new file mode 100644
index 0000000..a6e98bd
--- /dev/null
+++ b/test/integration/targets/templating_lookups/template_lookup_vaulted/templates/vaulted_hello.j2
@@ -0,0 +1,6 @@
+$ANSIBLE_VAULT;1.1;AES256
+33623433323331343363343830343365376233386637366264646634663632343963396664393463
+3734626234626639323061643863613164643365363063310a663336663762356135396430353435
+39303930613231336135623761363130653235666433383965306235653963343166633233323638
+6635303662333734300a623063393761376531636535383164333632613839663237336463616436
+62643437623538633335366435346532636666616139386332323034336530356131
diff --git a/test/integration/targets/templating_lookups/template_lookup_vaulted/test_vault_pass b/test/integration/targets/templating_lookups/template_lookup_vaulted/test_vault_pass
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/test/integration/targets/templating_lookups/template_lookup_vaulted/test_vault_pass
@@ -0,0 +1 @@
+test