Skip to content

Commit

Permalink
Docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Oct 5, 2017
1 parent 9338d73 commit ec0e92f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:16.04
MAINTAINER Mischa ter Smitten <[email protected]>

# python
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \
apt-get clean
RUN curl -sL https://bootstrap.pypa.io/get-pip.py | python -
RUN rm -rf $HOME/.cache

# ansible
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
apt-get clean
RUN pip install ansible==2.3.2.0
RUN rm -rf $HOME/.cache

# provision
COPY . /etc/ansible/roles/ansible-role
WORKDIR /etc/ansible/roles/ansible-role
RUN ansible-playbook -i tests/inventory tests/test.yml --connection=local -vvvv
14 changes: 14 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# handlers file for postfix
---
- name: restart postfix
command: /bin/true
notify:
- remove pid
- restart service

- name: remove pid
file:
path: "~postfix/pid/master.pid"
state: absent
when: >
(ansible_virtualization_role | default('host') == "guest")
and (ansible_virtualization_type | default('none') == "docker")
- name: restart service
service:
name: postfix
state: restarted
Expand Down

0 comments on commit ec0e92f

Please sign in to comment.