summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/include_import/roles/role_with_argspec/meta/argument_specs.yml7
-rw-r--r--test/integration/targets/include_import/roles/role_with_argspec/tasks/main.yml1
-rwxr-xr-xtest/integration/targets/include_import/runme.sh5
-rw-r--r--test/integration/targets/include_import/tasks/test_templating_IncludeRole_FA.yml28
4 files changed, 41 insertions, 0 deletions
diff --git a/test/integration/targets/include_import/roles/role_with_argspec/meta/argument_specs.yml b/test/integration/targets/include_import/roles/role_with_argspec/meta/argument_specs.yml
new file mode 100644
index 0000000000..e6d200c165
--- /dev/null
+++ b/test/integration/targets/include_import/roles/role_with_argspec/meta/argument_specs.yml
@@ -0,0 +1,7 @@
+argument_specs:
+ main:
+ short_description: The main entry point for dup_allowed_role
+ options:
+ optional_int:
+ type: int
+ description: An integer value
diff --git a/test/integration/targets/include_import/roles/role_with_argspec/tasks/main.yml b/test/integration/targets/include_import/roles/role_with_argspec/tasks/main.yml
new file mode 100644
index 0000000000..23f52ef574
--- /dev/null
+++ b/test/integration/targets/include_import/roles/role_with_argspec/tasks/main.yml
@@ -0,0 +1 @@
+- debug: msg='Running role_with_argspec'
diff --git a/test/integration/targets/include_import/runme.sh b/test/integration/targets/include_import/runme.sh
index d384a12e14..078f080b0d 100755
--- a/test/integration/targets/include_import/runme.sh
+++ b/test/integration/targets/include_import/runme.sh
@@ -121,6 +121,11 @@ ansible-playbook valid_include_keywords/playbook.yml "$@"
ansible-playbook tasks/test_allow_single_role_dup.yml 2>&1 | tee test_allow_single_role_dup.out
test "$(grep -c 'ok=3' test_allow_single_role_dup.out)" = 1
+# test templating public, allow_duplicates, and rolespec_validate
+ansible-playbook tasks/test_templating_IncludeRole_FA.yml 2>&1 | tee IncludeRole_FA_template.out
+test "$(grep -c 'ok=4' IncludeRole_FA_template.out)" = 1
+test "$(grep -c 'failed=0' IncludeRole_FA_template.out)" = 1
+
# https://github.com/ansible/ansible/issues/66764
ANSIBLE_HOST_PATTERN_MISMATCH=error ansible-playbook empty_group_warning/playbook.yml
diff --git a/test/integration/targets/include_import/tasks/test_templating_IncludeRole_FA.yml b/test/integration/targets/include_import/tasks/test_templating_IncludeRole_FA.yml
new file mode 100644
index 0000000000..cb67a9bb15
--- /dev/null
+++ b/test/integration/targets/include_import/tasks/test_templating_IncludeRole_FA.yml
@@ -0,0 +1,28 @@
+---
+- name: test templating allow_duplicates, public, and rolespec_validate
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: prevent duplicate roles with a templated value
+ block:
+ - import_role:
+ name: dup_allowed_role
+ allow_duplicates: "{{ False | bool }}"
+ - import_role:
+ name: dup_allowed_role
+ allow_duplicates: "{{ False | bool }}"
+
+ - name: prevent leaky vars with a templated value
+ include_role:
+ name: role1
+ public: "{{ False | bool }}"
+ - assert:
+ that:
+ - where_am_i_defined is undefined
+
+ - name: skip role argspec validation with a templated value
+ include_role:
+ name: role_with_argspec
+ rolespec_validate: "{{ False | bool }}"
+ vars:
+ optional_int: wrong_type