blob: 95413d0b8a8cbd25f4b1bd3588611ed589027735 [file] [log] [blame]
Zack Williams537bf9c2018-04-02 11:55:04 -07001---
Jonathan Hart93956f52017-08-22 13:12:42 -07002# 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
Zack Williams6fe46372017-06-29 08:30:21 -070016- name: Trust docker apt key
17 apt_key:
18 data={{ lookup('file', 'docker_apt_key.gpg') }}
19
David K. Bainbridgeb5415042016-05-13 17:06:10 -070020- name: Debian add Docker repository and update apt cache
21 apt_repository:
Zack Williams6fe46372017-06-29 08:30:21 -070022 repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070023 update_cache: yes
24 state: present
25 tags: [docker]
26
27- name: Debian Docker is present
28 apt:
Zack Williams6fe46372017-06-29 08:30:21 -070029 name: "docker-ce=17.06.*"
David K. Bainbridge17248c02016-08-29 17:04:34 -070030 state: present
David K. Bainbridgeb5415042016-05-13 17:06:10 -070031 force: yes
32 tags: [docker]
33
34- name: Debian python-pip is present
35 apt: name=python-pip state=present
36 tags: [docker]
37
38- name: Debian docker-py is present
39 pip:
Zack Williams537bf9c2018-04-02 11:55:04 -070040 name: "docker==3.2.1"
David K. Bainbridgeb5415042016-05-13 17:06:10 -070041 state: present
42 tags: [docker]
43
44- name: Debian files are present
45 template:
46 src: "{{ docker_cfg }}"
47 dest: "{{ docker_cfg_dest }}"
48 register: copy_result
49 tags: [docker]
50
51- name: Debian Daemon is reloaded
Zack Williamse2fc42a2018-01-31 18:38:58 -070052 systemd:
53 daemon_reload: yes
David K. Bainbridgeb5415042016-05-13 17:06:10 -070054 when: copy_result|changed and is_systemd is defined
55 tags: [docker]
56
57- name: vagrant user is added to the docker group
58 user:
59 name: vagrant
60 group: docker
61 register: user_result
62 tags: [docker]
63
64- name: Debian Docker service is restarted
65 service:
66 name: docker
67 state: restarted
68 when: copy_result|changed or user_result|changed
69 tags: [docker]
70
71- name: DockerUI is running
Zack Williams6fe46372017-06-29 08:30:21 -070072 docker_container:
David K. Bainbridgeb5415042016-05-13 17:06:10 -070073 image: abh1nav/dockerui
74 name: dockerui
75 ports: 9000:9000
76 privileged: yes
77 volumes:
78 - /var/run/docker.sock:/var/run/docker.sock
79 when: not skip_ui is defined
David K. Bainbridge17248c02016-08-29 17:04:34 -070080 tags: [docker]