Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 3d432b4

Browse files
committed
Update Apache, Git, and MySQL roles.
1 parent 4ff0953 commit 3d432b4

File tree

19 files changed

+133
-94
lines changed

19 files changed

+133
-94
lines changed

provisioning/requirements.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- src: geerlingguy.adminer
99
version: 1.1.1
1010
- src: geerlingguy.apache
11-
version: 2.0.2
11+
version: 2.1.0
1212
- src: geerlingguy.apache-php-fpm
1313
version: 1.0.2
1414
- src: geerlingguy.blackfire
@@ -28,15 +28,15 @@
2828
- src: geerlingguy.firewall
2929
version: 2.2.0
3030
- src: geerlingguy.git
31-
version: 1.2.1
31+
version: 1.3.0
3232
- src: geerlingguy.java
3333
version: 1.7.4
3434
- src: geerlingguy.mailhog
3535
version: 2.1.3
3636
- src: geerlingguy.memcached
3737
version: 1.0.7
3838
- src: geerlingguy.mysql
39-
version: 2.5.0
39+
version: 2.6.0
4040
- src: geerlingguy.nginx
4141
version: 2.0.0
4242
- src: geerlingguy.nodejs

provisioning/roles/geerlingguy.apache/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ galaxy_info:
66
description: Apache 2.x for Linux.
77
company: "Midwestern Mac, LLC"
88
license: "license (BSD, MIT)"
9-
min_ansible_version: 1.9
9+
min_ansible_version: 2.2
1010
platforms:
1111
- name: EL
1212
versions:

provisioning/roles/geerlingguy.apache/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- name: Get installed version of Apache.
2121
shell: "{{ apache_daemon_path }}{{ apache_daemon }} -v"
2222
changed_when: false
23-
always_run: yes
23+
check_mode: no
2424
register: _apache_version
2525

2626
- name: Create apache_version variable.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.LSOverride
1+
*.retry
2+
tests/test.sh

provisioning/roles/geerlingguy.git/.travis.yml

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,83 +4,53 @@ services: docker
44
env:
55
# Test source install on latest supported OSes.
66
- distro: centos7
7-
init: /usr/lib/systemd/systemd
8-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
97
playbook: test-source.yml
108
GIT_VERSION: 2.9.3
119
- distro: ubuntu1604
12-
init: /lib/systemd/systemd
13-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
1410
playbook: test-source.yml
1511
GIT_VERSION: 2.9.3
1612

1713
# Test package install on all supported OSes.
1814
- distro: centos7
19-
init: /usr/lib/systemd/systemd
20-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2115
playbook: test.yml
2216
GIT_VERSION: 1.8.3.1
2317
- distro: centos6
24-
init: /sbin/init
25-
run_opts: "--privileged"
2618
playbook: test.yml
2719
GIT_VERSION: 1.7.1
2820
- distro: fedora24
29-
init: /usr/lib/systemd/systemd
30-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
3121
playbook: test.yml
3222
GIT_VERSION: 2.7.4
3323
- distro: ubuntu1604
34-
init: /lib/systemd/systemd
35-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
3624
playbook: test.yml
3725
GIT_VERSION: 2.7.4
3826
- distro: ubuntu1404
39-
init: /sbin/init
40-
run_opts: "--privileged"
4127
playbook: test.yml
4228
GIT_VERSION: 1.9.1
4329
- distro: ubuntu1204
44-
init: /sbin/init
45-
run_opts: "--privileged"
4630
playbook: test.yml
4731
GIT_VERSION: 1.7.9.5
4832
- distro: debian8
49-
init: /lib/systemd/systemd
50-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
5133
playbook: test.yml
5234
GIT_VERSION: 2.1.4
5335

54-
before_install:
55-
# Pull container.
56-
- 'docker pull geerlingguy/docker-${distro}-ansible:latest'
57-
5836
script:
59-
- container_id=$(mktemp)
60-
# Run container in detached state.
61-
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'
62-
63-
# Ansible syntax check.
64-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} --syntax-check'
37+
# Configure test script so we can run extra tests after playbook is run.
38+
- export container_id=$(date +%s)
39+
- export cleanup=false
6540

66-
# Test role.
67-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}'
41+
# Download test shim.
42+
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
43+
- chmod +x ${PWD}/tests/test.sh
6844

69-
# Test role idempotence.
70-
- idempotence=$(mktemp)
71-
- docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | tee -a ${idempotence}
72-
- >
73-
tail ${idempotence}
74-
| grep -q 'changed=0.*failed=0'
75-
&& (echo 'Idempotence test: pass' && exit 0)
76-
|| (echo 'Idempotence test: fail' && exit 1)
45+
# Run tests.
46+
- ${PWD}/tests/test.sh
7747

7848
# Ensure Git is installed and at the right version.
79-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm which git'
80-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm test -x /usr/bin/git'
49+
- 'docker exec --tty ${container_id} env TERM=xterm which git'
50+
- 'docker exec --tty ${container_id} env TERM=xterm test -x /usr/bin/git'
8151

82-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm git --version'
83-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm /usr/bin/git --version | grep -qF "$GIT_VERSION"'
52+
- 'docker exec --tty ${container_id} env TERM=xterm git --version'
53+
- 'docker exec --tty ${container_id} env TERM=xterm /usr/bin/git --version | grep -qF "$GIT_VERSION"'
8454

8555
notifications:
8656
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Jeff Geerling
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

provisioning/roles/geerlingguy.git/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ MIT / BSD
5252

5353
## Author Information
5454

55-
This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
55+
This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

provisioning/roles/geerlingguy.git/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ galaxy_info:
66
description: Git version control software
77
company: "Midwestern Mac, LLC"
88
license: "license (BSD, MIT)"
9-
min_ansible_version: 2.0
9+
min_ansible_version: 2.2
1010
platforms:
1111
- name: EL
1212
versions:

provisioning/roles/geerlingguy.git/tasks/install-from-source.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
warn=no
3131
changed_when: false
3232
failed_when: false
33-
always_run: yes
33+
check_mode: no
3434
register: git_installed_version
3535

3636
- name: Force git install if the version numbers do not match
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ansible Role tests
2+
3+
To run the test playbook(s) in this directory:
4+
5+
1. Install and start Docker.
6+
1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`:
7+
- `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/`
8+
1. Make the test shim executable: `chmod +x tests/test.sh`.
9+
1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh`
10+
11+
If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`

0 commit comments

Comments
 (0)