blob: 36a8bcaab4579827699e997a8febba5703d60a0b [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Zack Williams6fe46372017-06-29 08:30:21 -070017---
18
19- name: Trust docker apt key
20 apt_key:
21 data={{ lookup('file', 'docker_apt_key.gpg') }}
22
David K. Bainbridgeb5415042016-05-13 17:06:10 -070023- name: Debian add Docker repository and update apt cache
24 apt_repository:
Zack Williams6fe46372017-06-29 08:30:21 -070025 repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070026 update_cache: yes
27 state: present
28 tags: [docker]
29
30- name: Debian Docker is present
31 apt:
Zack Williams6fe46372017-06-29 08:30:21 -070032 name: "docker-ce=17.06.*"
David K. Bainbridge17248c02016-08-29 17:04:34 -070033 state: present
David K. Bainbridgeb5415042016-05-13 17:06:10 -070034 force: yes
35 tags: [docker]
36
37- name: Debian python-pip is present
38 apt: name=python-pip state=present
39 tags: [docker]
40
41- name: Debian docker-py is present
42 pip:
Zack Williams6fe46372017-06-29 08:30:21 -070043 name: "docker==2.4.2"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070044 state: present
45 tags: [docker]
46
47- name: Debian files are present
48 template:
49 src: "{{ docker_cfg }}"
50 dest: "{{ docker_cfg_dest }}"
51 register: copy_result
52 tags: [docker]
53
54- name: Debian Daemon is reloaded
Zack Williamse2fc42a2018-01-31 18:38:58 -070055 systemd:
56 daemon_reload: yes
David K. Bainbridgeb5415042016-05-13 17:06:10 -070057 when: copy_result|changed and is_systemd is defined
58 tags: [docker]
59
60- name: vagrant user is added to the docker group
61 user:
62 name: vagrant
63 group: docker
64 register: user_result
65 tags: [docker]
66
67- name: Debian Docker service is restarted
68 service:
69 name: docker
70 state: restarted
71 when: copy_result|changed or user_result|changed
72 tags: [docker]
73
74- name: DockerUI is running
Zack Williams6fe46372017-06-29 08:30:21 -070075 docker_container:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070076 image: abh1nav/dockerui
77 name: dockerui
78 ports: 9000:9000
79 privileged: yes
80 volumes:
81 - /var/run/docker.sock:/var/run/docker.sock
82 when: not skip_ui is defined
David K. Bainbridge17248c02016-08-29 17:04:34 -070083 tags: [docker]