Skip to content

Commit

Permalink
Merge pull request #2 from hellofresh/add-docker-conf
Browse files Browse the repository at this point in the history
make docker conf configurable
  • Loading branch information
ahelal authored Oct 10, 2016
2 parents ff946a7 + acfb745 commit e597140
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
6 changes: 6 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: restart docker
service:
name="docker"
state="restarted"

4 changes: 2 additions & 2 deletions tasks/composer.yml → tasks/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

- name: Ensure composer dir exists
- name: Ensure docker compose dir exists
file:
path="{{ docker_compose_dir }}"
mode=0755
state="directory"

- name: Download composer
- name: Download docker compose
get_url:
url="{{ docker_compose_url }}"
dest="{{ docker_compose_dir }}/{{ docker_compose_file }}"
Expand Down
11 changes: 9 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
apt:
pkg="docker-engine"

- name: Include composer
include: composer.yml
- name: Include docker-compose.yml
include: docker-compose.yml
when: docker_compose_install

- name: Include docker conf
template:
src=docker_conf_ubuntu_14.04.j2
dest=/etc/default/docker
notify:
- restart docker

- name: Ensure docker is running and starts by default
service:
name="docker"
Expand Down
29 changes: 29 additions & 0 deletions templates/docker_conf_ubuntu_14.04.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# {{ ansible_managed }}
# Docker Upstart and SysVinit configuration file

#
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
# Please see the documentation for "systemd drop-ins":
# https://docs.docker.com/engine/articles/systemd/
#

# Customize location of Docker binary (especially for development testing).
{% if dockerhost_dockererd is defined %}
DOCKERD="{{ dockerhost_dockererd }}"
{% endif %}

# Use DOCKER_OPTS to modify the daemon startup options.
{% if dockerhost_docker_opts is defined %}
DOCKER_OPTS="{{ dockerhost_docker_opts }}"
{% endif %}

# If you need Docker to use an HTTP proxy, it can also be specified here.
{% if dockerhost_http_proxy is defined %}
export http_proxy="{{ dockerhost_http_proxy }}"
{% endif %}

# This is also a handy place to tweak where Docker's temporary files go.
{% if dockerhost_tmpdir is defined %}
export TMPDIR="{{ dockerhost_tmpdir }}"
{% endif %}

0 comments on commit e597140

Please sign in to comment.