blob: 0124407c7a5f08abefa5a07c8ae2baa7aa1dab87 [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
55 command: systemctl daemon-reload
56 when: copy_result|changed and is_systemd is defined
57 tags: [docker]
58
59- name: vagrant user is added to the docker group
60 user:
61 name: vagrant
62 group: docker
63 register: user_result
64 tags: [docker]
65
66- name: Debian Docker service is restarted
67 service:
68 name: docker
69 state: restarted
70 when: copy_result|changed or user_result|changed
71 tags: [docker]
72
73- name: DockerUI is running
Zack Williams6fe46372017-06-29 08:30:21 -070074 docker_container:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070075 image: abh1nav/dockerui
76 name: dockerui
77 ports: 9000:9000
78 privileged: yes
79 volumes:
80 - /var/run/docker.sock:/var/run/docker.sock
81 when: not skip_ui is defined
David K. Bainbridge17248c02016-08-29 17:04:34 -070082 tags: [docker]