Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from lae/feature/ubuntu-alpine-updates
Browse files Browse the repository at this point in the history
Add current Alpine releases and Ubuntu 20.04
  • Loading branch information
lae authored May 6, 2020
2 parents f17a27a + bb3c7a6 commit 9333b05
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 122 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ install:
before_script: cd tests/
script:
- ansible-playbook -i inventory deploy.yml --syntax-check
- ansible-playbook -i inventory -v deploy.yml
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook -vvi inventory
deploy.yml > play.log || (e=$?; cat play.log; exit $e); printf "Idempotence: ";
- ANSIBLE_DISPLAY_SKIPPED_HOSTS=no ansible-playbook -i inventory deploy.yml
- 'ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=no ANSIBLE_DISPLAY_OK_HOSTS=no
unbuffer ansible-playbook -vvi inventory deploy.yml &>play.log; printf "Idempotence: ";
grep -A1 "PLAY RECAP" play.log | grep -qP "changed=0 .*failed=0 .*"
&& (echo "PASS"; exit 0) || (echo "FAIL"; cat play.log; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory -v test.yml
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ script:
# Validates your deployment playbook's syntax, which should contain your role
- ansible-playbook -i inventory deploy.yml --syntax-check
# Runs the deployment playbook
- ansible-playbook -i inventory -v deploy.yml
- ansible-playbook -i inventory deploy.yml
# Runs the deployment playbook again, saving output to a file called play.log,
# then checks that there are no changed/failed tasks and fails if there are.
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook -vv -i inventory
deploy.yml > play.log || (e=$?; cat play.log; exit $e); printf "Idempotence: ";
- 'ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=no ANSIBLE_DISPLAY_OK_HOSTS=no
unbuffer ansible-playbook -vvi inventory deploy.yml &>play.log; printf "Idempotence: ";
grep -A1 "PLAY RECAP" play.log | grep -qP "changed=0 .*failed=0 .*"
&& (echo "PASS"; exit 0) || (echo "FAIL"; cat play.log; exit 1)'
# Integration tests and what not
Expand All @@ -61,7 +61,7 @@ build process, but the following is what typically serves most purposes:
test_profiles:
- profile: debian-buster
- profile: ubuntu-focal
- profile: centos-8
- profile: centos-7
- profile: alpine-v3.11
# Add any other setup tasks you might need but don't necessarily need in your role
Expand Down Expand Up @@ -122,7 +122,7 @@ And finally, the inventory:
```ini
debian-buster-01
ubuntu-focal-01
centos-8-01
centos-7-01
alpine-v3-11-01
```

Expand Down Expand Up @@ -199,12 +199,9 @@ test_profiles:
- profile: alpine-v3.11
- profile: alpine-v3.10
- profile: alpine-v3.9
- profile: centos-8
- profile: centos-7
- profile: debian-buster
- profile: debian-stretch
- profile: fedora-32
- profile: fedora-31
- profile: ubuntu-focal
- profile: ubuntu-bionic
- profile: ubuntu-xenial
Expand All @@ -223,8 +220,6 @@ test_profiles:
- profile: centos-6
- profile: debian-jessie
- profile: debian-wheezy
- profile: fedora-30
- profile: fedora-29
- profile: fedora-28
- profile: fedora-27
- profile: fedora-26
Expand Down
13 changes: 5 additions & 8 deletions tests/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
- m4
test_hosts_per_profile: 2
test_profiles:
- profile: alpine-v3.11
- profile: alpine-v3.10
- profile: alpine-v3.9
- profile: centos-7
- profile: debian-buster
prefix: debian-buster-test-
- profile: debian-stretch
- profile: debian-jessie
- profile: centos-7
- profile: centos-6
- profile: ubuntu-focal
- profile: ubuntu-bionic
- profile: ubuntu-xenial
- profile: fedora-28
- profile: fedora-27
- profile: alpine-v3.8
- profile: alpine-v3.7
- profile: alpine-v3.6
11 changes: 3 additions & 8 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
alpine-v3-[9:11]-[01:02]
centos-7-[01:02]
# following is used when testing that test_profiles.*.prefix works
debian-buster-test-[01:02]
# the rest are standard fare
debian-jessie-[01:02]
debian-stretch-[01:02]
centos-7-[01:02]
centos-6-[01:02]
ubuntu-focal-[01:02]
ubuntu-bionic-[01:02]
ubuntu-xenial-[01:02]
fedora-28-[01:02]
fedora-27-[01:02]
alpine-v3-8-[01:02]
alpine-v3-7-[01:02]
alpine-v3-6-[01:02]
Loading

0 comments on commit 9333b05

Please sign in to comment.