Skip to content

Commit

Permalink
Assures we test role installation with dependency (#2877)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Oct 12, 2020
1 parent daf4feb commit 1506f1d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
- name: Validate that collection was installed
debug:
msg: "{{ 'foo' | community.molecule.header }}"

- name: test installed role
include_role:
name: ssbarnea.ansible_role_helloworld
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ platforms:
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
scenario:
name: ansible-galaxy
verifier:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# See https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-roles-and-collections-from-the-same-requirements-yml-file
collections:
- community.molecule
roles: []
roles:
- ssbarnea.ansible_role_helloworld
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
- name: Validate that collection was installed
debug:
msg: "{{ 'foo' | community.molecule.header }}"

- name: test installed role
include_role:
name: ssbarnea.ansible_role_helloworld
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
dependency:
name: shell
command: >
ansible-galaxy collection install -p "${MOLECULE_EPHEMERAL_DIRECTORY}/collections" community.molecule
bash -c "
ansible-galaxy collection install -p '${MOLECULE_EPHEMERAL_DIRECTORY}/collections' community.molecule &&
ansible-galaxy role install -p '${MOLECULE_EPHEMERAL_DIRECTORY}/roles' ssbarnea.ansible_role_helloworld
"
driver:
name: delegated
platforms:
- name: instance
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
scenario:
name: shell
verifier:
Expand Down

0 comments on commit 1506f1d

Please sign in to comment.