Debian Codegraph @

test/integration/targets/module_precedence/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 # Standard ping module
6 ansible-playbook modules_test.yml -i ../../inventory -v "$@"
7
8 # Library path ping module
9 ANSIBLE_LIBRARY=lib_with_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@"
10 ANSIBLE_LIBRARY=lib_no_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@"
11
12 # ping module from role
13 ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
14 ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
15
16 # ping module from role when there's a library path module too
17 ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
18 ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
19 ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
20 ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
21
22 # ping module in multiple roles: Note that this will use the first module found
23 # which is the current way things work but may not be the best way
24 ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
25 ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
26 ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
27 ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
28
29 # And prove that with multiple roles, it's the order the roles are listed in the play that matters
30 ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles_reverse_order.yml -i ../../inventory -v "$@"
31
32 # Tests for MODULE_IGNORE_EXTS.
33 #
34 # Very similar to two tests above, but adds a check to test extension
35 # precedence. Separate from the above playbooks because we *only* care about
36 # extensions here and 'a' will not exist when the above playbooks run with
37 # non-extension library/role paths. There is also no way to guarantee that
38 # these tests will be useful due to how the pluginloader seems to work. It uses
39 # os.listdir which returns things in an arbitrary order (likely dependent on
40 # filesystem). If it happens to return 'a.py' on the test node before it
41 # returns 'a.ini', then this test is pointless anyway because there's no chance
42 # that 'a.ini' would ever have run regardless of what MODULE_IGNORE_EXTS is set
43 # to. The hope is that we test across enough systems that one would fail this
44 # test if the MODULE_IGNORE_EXTS broke, but there is no guarantee. This would
45 # perhaps be better as a mocked unit test because of this but would require
46 # a fair bit of work to be feasible as none of that loader logic is tested at
47 # all right now.
48 ANSIBLE_LIBRARY=lib_with_extension ansible-playbook modules_test_envvar_ext.yml -i ../../inventory -v "$@"
49 ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role_ext.yml -i ../../inventory -v "$@"