blob: 23703aff0d547db150dd29f98a240b539eef087e [file] [log] [blame]
Zack Williamse4fbacc2016-05-21 07:18:43 -07001---
2# Installs docker with apt, docker-compose with pip, adds user to group
3# Must be run as root
4
Zack Williams9e74c4a2016-05-21 10:00:03 -07005- hosts: docker
6 remote_user: ubuntu
7 become: yes
Zack Williamse4fbacc2016-05-21 07:18:43 -07008
Zack Williams9e74c4a2016-05-21 10:00:03 -07009 tasks:
Zack Williamse4fbacc2016-05-21 07:18:43 -070010
Zack Williams9e74c4a2016-05-21 10:00:03 -070011 # https://docs.docker.com/engine/installation/linux/ubuntulinux/
12 - name: Prereqs and SSL support for apt for SSL
13 apt:
14 name={{ item }}
15 update_cache=yes
16 cache_valid_time=3600
17 with_items:
18 - apt-transport-https
19 - ca-certificates
20 - python-pip
Zack Williamse4fbacc2016-05-21 07:18:43 -070021
Zack Williams9e74c4a2016-05-21 10:00:03 -070022 - name: Trust docker apt key
23 apt_key:
24 keyserver=pool.sks-keyservers.net
25 id=58118E89F3A912897C070ADBF76221572C52609D
Zack Williamse4fbacc2016-05-21 07:18:43 -070026
Zack Williams9e74c4a2016-05-21 10:00:03 -070027 - name: Add docker apt repo
28 apt_repository:
29 repo="deb https://apt.dockerproject.org/repo ubuntu-trusty main"
Zack Williamse4fbacc2016-05-21 07:18:43 -070030
Zack Williams9e74c4a2016-05-21 10:00:03 -070031 - name: Install docker
32 apt:
33 update_cache=yes
34 cache_valid_time=3600
35 name=docker-engine
36
Zack Williamsb31027a2016-05-23 07:40:06 -070037 - name: Install docker-compose from web
38 get_url:
39 url=https://github.com/docker/compose/releases/download/1.7.1/docker-compose-Linux-x86_64
40 checksum=sha256:3166bb74bc648e68c3154bc704fddf6bccf59f03a0c90fc48aefac034535e4ae
41 dest=/usr/local/bin/docker-compose
42 owner=root mode=0755
Zack Williamse4fbacc2016-05-21 07:18:43 -070043
Zack Williamsb31027a2016-05-23 07:40:06 -070044 # This installs a bunch of prereqs that currently breaks SSL and CA's
45 # https://docs.docker.com/compose/install/#install-using-pip
46 #- name: Install docker-compose from PyPi
47 # pip:
48 # name=docker-compose
Zack Williams1a105712016-05-22 07:38:39 -070049
50 - name: Make ubuntu user part of the Docker group
51 user:
52 name="ubuntu"
53 groups="docker"
54 append=yes
55
56 - name: restart Docker daemon to get new group membership
57 service:
58 name=docker
59 state=restarted
60