summaryrefslogtreecommitdiffstats
path: root/test/local-content/test-roles-failed-complete
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /test/local-content/test-roles-failed-complete
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/local-content/test-roles-failed-complete')
-rwxr-xr-xtest/local-content/test-roles-failed-complete/roles/role1/library/test_module_1_failed_complete.py14
-rw-r--r--test/local-content/test-roles-failed-complete/roles/role1/tasks/main.yml3
-rw-r--r--test/local-content/test-roles-failed-complete/roles/role2/tasks/main.yml11
-rw-r--r--test/local-content/test-roles-failed-complete/roles/role2/test_plugins/b_failed_complete.py19
-rwxr-xr-xtest/local-content/test-roles-failed-complete/roles/role3/library/test_module_3_failed_complete.py14
-rw-r--r--test/local-content/test-roles-failed-complete/roles/role3/tasks/main.yml3
6 files changed, 64 insertions, 0 deletions
diff --git a/test/local-content/test-roles-failed-complete/roles/role1/library/test_module_1_failed_complete.py b/test/local-content/test-roles-failed-complete/roles/role1/library/test_module_1_failed_complete.py
new file mode 100755
index 0000000..d9012a7
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role1/library/test_module_1_failed_complete.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+"""A module."""
+
+from ansible.module_utils.basic import AnsibleModule
+
+
+def main() -> None:
+ """Execute module."""
+ module = AnsibleModule({})
+ module.exit_json(msg="Hello 1!")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/test/local-content/test-roles-failed-complete/roles/role1/tasks/main.yml b/test/local-content/test-roles-failed-complete/roles/role1/tasks/main.yml
new file mode 100644
index 0000000..680dcab
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role1/tasks/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Use local module 1
+ test_module_1_failed_complete:
diff --git a/test/local-content/test-roles-failed-complete/roles/role2/tasks/main.yml b/test/local-content/test-roles-failed-complete/roles/role2/tasks/main.yml
new file mode 100644
index 0000000..8646f6b
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role2/tasks/main.yml
@@ -0,0 +1,11 @@
+---
+- name: Use local module from other role that has been included before this one
+ # If it has not been included before, loading this role fails!
+ test_module_1_failed_complete:
+- name: Use local module from other role that has been included before this one
+ # If it has not been included before, loading this role fails!
+ test_module_3_failed_complete:
+- name: Use local test plugin
+ assert:
+ that:
+ - "'2' is b_test_failed_complete '12345'"
diff --git a/test/local-content/test-roles-failed-complete/roles/role2/test_plugins/b_failed_complete.py b/test/local-content/test-roles-failed-complete/roles/role2/test_plugins/b_failed_complete.py
new file mode 100644
index 0000000..92bd6e7
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role2/test_plugins/b_failed_complete.py
@@ -0,0 +1,19 @@
+"""A test plugin."""
+# pylint: disable=invalid-name
+
+
+def compatibility_in_test(a, b):
+ """Return True when a is contained in b."""
+ return a in b
+
+
+# pylint: disable=too-few-public-methods
+class TestModule:
+ """Test plugin."""
+
+ @staticmethod
+ def tests():
+ """Return tests."""
+ return {
+ "b_test_failed_complete": compatibility_in_test,
+ }
diff --git a/test/local-content/test-roles-failed-complete/roles/role3/library/test_module_3_failed_complete.py b/test/local-content/test-roles-failed-complete/roles/role3/library/test_module_3_failed_complete.py
new file mode 100755
index 0000000..4d9de0e
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role3/library/test_module_3_failed_complete.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+"""A module."""
+
+from ansible.module_utils.basic import AnsibleModule
+
+
+def main() -> None:
+ """Execute module."""
+ module = AnsibleModule({})
+ module.exit_json(msg="Hello 3!")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/test/local-content/test-roles-failed-complete/roles/role3/tasks/main.yml b/test/local-content/test-roles-failed-complete/roles/role3/tasks/main.yml
new file mode 100644
index 0000000..7a36734
--- /dev/null
+++ b/test/local-content/test-roles-failed-complete/roles/role3/tasks/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Use local module 3
+ test_module_3_failed_complete: