Skip to content

Commit 1506f1d

Browse files
authored
Assures we test role installation with dependency (#2877)
1 parent daf4feb commit 1506f1d

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

molecule/test/scenarios/dependency/molecule/ansible-galaxy/converge.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
- name: Validate that collection was installed
88
debug:
99
msg: "{{ 'foo' | community.molecule.header }}"
10+
11+
- name: test installed role
12+
include_role:
13+
name: ssbarnea.ansible_role_helloworld

molecule/test/scenarios/dependency/molecule/ansible-galaxy/molecule.yml

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ platforms:
88
image: ${TEST_BASE_IMAGE}
99
provisioner:
1010
name: ansible
11-
env:
12-
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
1311
scenario:
1412
name: ansible-galaxy
1513
verifier:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# See https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-roles-and-collections-from-the-same-requirements-yml-file
22
collections:
33
- community.molecule
4-
roles: []
4+
roles:
5+
- ssbarnea.ansible_role_helloworld

molecule/test/scenarios/dependency/molecule/shell/converge.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
- name: Validate that collection was installed
88
debug:
99
msg: "{{ 'foo' | community.molecule.header }}"
10+
11+
- name: test installed role
12+
include_role:
13+
name: ssbarnea.ansible_role_helloworld

molecule/test/scenarios/dependency/molecule/shell/molecule.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
dependency:
33
name: shell
44
command: >
5-
ansible-galaxy collection install -p "${MOLECULE_EPHEMERAL_DIRECTORY}/collections" community.molecule
5+
bash -c "
6+
ansible-galaxy collection install -p '${MOLECULE_EPHEMERAL_DIRECTORY}/collections' community.molecule &&
7+
ansible-galaxy role install -p '${MOLECULE_EPHEMERAL_DIRECTORY}/roles' ssbarnea.ansible_role_helloworld
8+
"
69
driver:
710
name: delegated
811
platforms:
912
- name: instance
1013
image: ${TEST_BASE_IMAGE}
1114
provisioner:
1215
name: ansible
13-
env:
14-
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
1516
scenario:
1617
name: shell
1718
verifier:

0 commit comments

Comments
 (0)