blob: 86fe7dbcbe8d26f82a5416c0187d29cd8c42b800 [file] [log] [blame]
Zack Williams6fe46372017-06-29 08:30:21 -07001---
2
3- name: Trust docker apt key
4 apt_key:
5 data={{ lookup('file', 'docker_apt_key.gpg') }}
6
David K. Bainbridgeb5415042016-05-13 17:06:10 -07007- name: Debian add Docker repository and update apt cache
8 apt_repository:
Zack Williams6fe46372017-06-29 08:30:21 -07009 repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070010 update_cache: yes
11 state: present
12 tags: [docker]
13
14- name: Debian Docker is present
15 apt:
Zack Williams6fe46372017-06-29 08:30:21 -070016 name: "docker-ce=17.06.*"
David K. Bainbridge17248c02016-08-29 17:04:34 -070017 state: present
David K. Bainbridgeb5415042016-05-13 17:06:10 -070018 force: yes
19 tags: [docker]
20
21- name: Debian python-pip is present
22 apt: name=python-pip state=present
23 tags: [docker]
24
25- name: Debian docker-py is present
26 pip:
Zack Williams6fe46372017-06-29 08:30:21 -070027 name: "docker==2.4.2"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070028 state: present
29 tags: [docker]
30
31- name: Debian files are present
32 template:
33 src: "{{ docker_cfg }}"
34 dest: "{{ docker_cfg_dest }}"
35 register: copy_result
36 tags: [docker]
37
38- name: Debian Daemon is reloaded
39 command: systemctl daemon-reload
40 when: copy_result|changed and is_systemd is defined
41 tags: [docker]
42
43- name: vagrant user is added to the docker group
44 user:
45 name: vagrant
46 group: docker
47 register: user_result
48 tags: [docker]
49
50- name: Debian Docker service is restarted
51 service:
52 name: docker
53 state: restarted
54 when: copy_result|changed or user_result|changed
55 tags: [docker]
56
57- name: DockerUI is running
Zack Williams6fe46372017-06-29 08:30:21 -070058 docker_container:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070059 image: abh1nav/dockerui
60 name: dockerui
61 ports: 9000:9000
62 privileged: yes
63 volumes:
64 - /var/run/docker.sock:/var/run/docker.sock
65 when: not skip_ui is defined
David K. Bainbridge17248c02016-08-29 17:04:34 -070066 tags: [docker]