diff --git a/.travis.yml b/.travis.yml index 4abe3fc..449c00e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,9 @@ script: # Run container in detached state. - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${repository}:${version} "${init}" > "${container_id}"' + # Install dependencies. + - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' + # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' diff --git a/tests/requirements.yml b/tests/requirements.yml new file mode 100644 index 0000000..6208520 --- /dev/null +++ b/tests/requirements.yml @@ -0,0 +1,2 @@ +--- +- src: geerlingguy.git diff --git a/tests/test.yml b/tests/test.yml index 3646ff4..f8abd3e 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -2,4 +2,5 @@ - hosts: all roles: + - geerlingguy.git - role_under_test