blob: 2beb5c7c450458d199c58218b6fe81fe42c5bb50 [file] [log] [blame]
Zack Williamsa2763112017-01-03 11:38:38 -07001---
2# docker-install/tasks/main.yml
3# note - all tasks run with become to preserve the `ansible_user_id` var
4
5- name: Prereqs and SSL support for apt for SSL
6 become: yes
7 apt:
Zack Williams1396aa32017-06-06 10:28:29 -07008 name: "{{ item }}"
9 update_cache: yes
10 cache_valid_time: 3600
Zack Williamsa2763112017-01-03 11:38:38 -070011 with_items:
12 - apt-transport-https
13 - ca-certificates
14 - python-pip
15
16- name: Trust docker apt key
17 become: yes
18 apt_key:
19 data: "{{ lookup('file', 'docker_apt_key.gpg') }}"
20
21- name: Add docker apt repo
22 become: yes
23 apt_repository:
24 repo: "{{ docker_apt_repo }}"
25
26- name: Install docker
27 become: yes
28 apt:
Zack Williams1396aa32017-06-06 10:28:29 -070029 name: docker-engine
30 update_cache: yes
31 cache_valid_time: 3600
Zack Williamsa2763112017-01-03 11:38:38 -070032
33# docker fails without docker-py, docker-compose >1.9 fails with docker-py installed
34- name: Install docker-compose and docker-py
35 become: yes
36 pip:
37 name: "{{ item }}"
38 with_items:
39 - docker-py
40 - docker-compose==1.9
41
42- name: Make current user part of the Docker group
43 become: yes
44 user:
45 name: "{{ ansible_user_id }}"
46 groups: "docker"
47 append: yes
48