Skip to content

Commit

Permalink
Merge pull request #1 from hellofresh/feature/add-docker-py
Browse files Browse the repository at this point in the history
Install docker-py as Ansible docker module prerequisite.
  • Loading branch information
ahelal committed Mar 30, 2016
2 parents 59c2296 + c004bd4 commit 3b961d1
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
dockerhost_group : "docker"
docker_compose_version : "1.6.2"
docker_compose_dir : "/opt/docker_compose"
docker_compose_install : True
docker_compose_install : True
docker_install_py_module : False
5 changes: 5 additions & 0 deletions tasks/docker-py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

- name: Install docker-py Python module
pip:
name="docker-py"
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- name: Include apt tasks
include: apt.yml

- name: Include docker-py
include: docker-py.yml
when: docker_install_py_module

- name: Install docker engine
apt:
pkg="docker-engine"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/defaults/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name : Default
hosts : "all"
hosts : all
gather_facts : True
become : True
connection : "{{ kitchen_connection | default('local') }}"
Expand Down
9 changes: 9 additions & 0 deletions test/integration/defaults/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'serverspec'

# Required by serverspec
set :backend, :exec

# Default version
describe command('docker --version') do
its(:stdout) { should contain('1.10') }
end
18 changes: 18 additions & 0 deletions test/integration/docker-py/docker-py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

- name : docker-py
hosts : "all"
gather_facts : True
become : True
connection : "{{ kitchen_connection | default('local') }}"
vars :
docker_install_py_module : True

pre_tasks :
- name: Install pip
apt:
name="python-pip"
update_cache=yes
cache_valid_time=3600
roles :
- "ansible-dockerhost"
9 changes: 9 additions & 0 deletions test/integration/docker-py/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'serverspec'

# Required by serverspec
set :backend, :exec

# Default version
describe command('docker --version') do
its(:stdout) { should contain('1.10') }
end

0 comments on commit 3b961d1

Please sign in to comment.