mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-09 11:20:18 +01:00
Add a custom initctl script to fix Ubuntu 14.04. Disable 12.04
This commit is contained in:
parent
7038d6ed61
commit
6e9b80c193
4 changed files with 35 additions and 6 deletions
12
.travis.yml
12
.travis.yml
|
@ -17,11 +17,11 @@ env:
|
|||
init: /sbin/init
|
||||
run_opts: ""
|
||||
playbook: test.yml
|
||||
- distribution: ubuntu
|
||||
version: 12.04
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
playbook: test.yml
|
||||
# - distribution: ubuntu
|
||||
# version: 12.04
|
||||
# init: /sbin/init
|
||||
# run_opts: ""
|
||||
# playbook: test.yml
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
@ -70,4 +70,4 @@ script:
|
|||
|| (echo 'MySQL not running' && exit 1)
|
||||
|
||||
# Clean up
|
||||
- 'sudo docker stop "$(cat ${container_id})"'
|
||||
- sudo docker stop "$(cat ${container_id})"
|
||||
|
|
|
@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible
|
|||
RUN apt-get update
|
||||
RUN apt-get install -y ansible
|
||||
|
||||
COPY initctl_faker .
|
||||
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl
|
||||
|
||||
# Install Ansible inventory file
|
||||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||
|
|
|
@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible
|
|||
RUN apt-get update
|
||||
RUN apt-get install -y ansible
|
||||
|
||||
COPY initctl_faker .
|
||||
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl
|
||||
|
||||
# Install Ansible inventory file
|
||||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||
|
|
23
tests/initctl_faker
Normal file
23
tests/initctl_faker
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
ALIAS_CMD="$(echo ""$0"" | sed -e 's?/sbin/??')"
|
||||
|
||||
case "$ALIAS_CMD" in
|
||||
start|stop|restart|reload|status)
|
||||
exec service $1 $ALIAS_CMD
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
list )
|
||||
exec service --status-all
|
||||
;;
|
||||
reload-configuration )
|
||||
exec service $2 restart
|
||||
;;
|
||||
start|stop|restart|reload|status)
|
||||
exec service $2 $1
|
||||
;;
|
||||
\?)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
Loading…
Reference in a new issue