-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from maaaikoool/master
Idempotence fix and travis test support
- Loading branch information
Showing
6 changed files
with
56 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -y curl | ||
|
||
install: | ||
# Install Ansible. | ||
- pip install ansible | ||
|
||
# Add ansible.cfg to pick up roles path. | ||
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" | ||
|
||
script: | ||
# Check the role/playbook's syntax. | ||
- "ansible-playbook -i tests/hosts tests/test.yml --syntax-check" | ||
|
||
# Run the role/playbook with ansible-playbook. | ||
- "ansible-playbook -i tests/hosts tests/test.yml --connection=local --sudo" | ||
|
||
# Run the role/playbook again, checking to make sure it's idempotent. | ||
- > | ||
ansible-playbook -i tests/hosts tests/test.yml --connection=local --sudo | ||
| grep -q 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
# Make sure nexus is running | ||
- curl http://localhost:8081/nexus |
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
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 @@ | ||
[nexus] | ||
localhost |
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,7 @@ | ||
--- | ||
- hosts: nexus | ||
gather_facts: yes | ||
roles: | ||
- ansible-nexus-oss | ||
tasks: | ||
- wait_for: port=8081 delay=10 |