-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests inside of docker container (#5)
Fix issue #4
- Loading branch information
1 parent
e87fda8
commit 5926fee
Showing
12 changed files
with
89 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.retry | ||
tests/roles/provision_docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
--- | ||
sudo: required | ||
language: python | ||
python: "2.7" | ||
|
||
sudo: true | ||
services: | ||
- docker | ||
|
||
# Install ansible | ||
env: | ||
global: | ||
- ANSIBLE_HOST_KEY_CHECKING="False" | ||
|
||
# Install python-pip | ||
addons: | ||
apt: | ||
packages: | ||
- python-pip | ||
- python-pip | ||
|
||
install: | ||
# Install ansible | ||
- pip install ansible | ||
- pip install ansible docker-py | ||
|
||
# Check ansible version | ||
- ansible --version | ||
|
||
# Create ansible.cfg with correct roles_path | ||
- printf '[defaults]\nroles_path=../' >ansible.cfg | ||
# Install ansible role tests requirements | ||
- ansible-galaxy install -r tests/requirements.yml -p tests/roles/ | ||
|
||
script: | ||
# Basic role syntax check | ||
- ansible-playbook tests/test.yml -i tests/inventory --skip-tag=poweroff --syntax-check | ||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check | ||
# Execute playbook | ||
- ansible-playbook tests/test.yml -i tests/inventory --skip-tag=poweroff | ||
- ansible-playbook tests/test.yml -i tests/inventory | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# This option allows run seal role under container | ||
seal_run_containerized: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
localhost ansible_connection=local | ||
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- src: chrismeyersfsu.provision_docker | ||
name: provision_docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
--- | ||
- hosts: localhost | ||
become: true | ||
become_method: sudo | ||
become_user: root | ||
- name: Bring up docker containers | ||
hosts: localhost | ||
gather_facts: false | ||
vars: | ||
inventory: | ||
- name: seal_centos6 | ||
image: "chrismeyers/centos6" | ||
- name: seal_centos7 | ||
image: "chrismeyers/centos7" | ||
- name: seal_rhel6 | ||
image: "registry.access.redhat.com/rhel6:latest" | ||
- name: seal_rhel7 | ||
image: "registry.access.redhat.com/rhel:latest" | ||
# Role doesn't support ubuntu | ||
# - name: seal_ubuntu12 | ||
# image: "chrismeyers/ubuntu12.04" | ||
# - name: seal_ubuntu14 | ||
# image: "ubuntu-upstart:14.04" | ||
roles: | ||
- ansible-role-seal | ||
- role: provision_docker | ||
provision_docker_inventory: "{{ inventory }}" | ||
|
||
|
||
- name: Run seal tests on containerized environments | ||
hosts: docker_containers | ||
vars: | ||
seal_run_containerized: yes | ||
roles: | ||
- role: seal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
seal_hostname_file_path: /etc/sysconfig/network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
seal_hostname_file_path: /etc/hostname |