blob: 3a39bb908c7ff1d898c5c3f84009a6f53f2458f2 [file] [log] [blame]
Matteo Scandolo60b640f2017-08-08 13:05:22 -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 Williams8ad44d52017-06-29 08:40:38 -070017---
18
Luca Pretec15c6492017-02-17 11:28:10 -080019- name: Trust docker apt key
20 apt_key:
21 data={{ lookup('file', 'docker_apt_key.gpg') }}
22
Zsolt Harasztiec7df102016-05-05 13:34:18 -070023- name: Debian add Docker repository and update apt cache
24 apt_repository:
Zack Williams8ad44d52017-06-29 08:40:38 -070025 repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070026 update_cache: yes
27 state: present
28 tags: [docker]
29
Zack Williams8ad44d52017-06-29 08:40:38 -070030- name: Install docker-ce using apt
Zsolt Harasztiec7df102016-05-05 13:34:18 -070031 apt:
Zack Williams8ad44d52017-06-29 08:40:38 -070032 name: docker-ce=17.06.*
Zsolt Harasztiec7df102016-05-05 13:34:18 -070033 force: yes
David K. Bainbridgef5ffb0d2016-11-04 16:14:54 +010034 tags: [docker, skip_ansible_lint]
Zsolt Harasztiec7df102016-05-05 13:34:18 -070035
36- name: Debian python-pip is present
37 apt: name=python-pip state=present
38 tags: [docker]
39
Zack Williams8ad44d52017-06-29 08:40:38 -070040- name: docker python package present
Zsolt Harasztiec7df102016-05-05 13:34:18 -070041 pip:
Zack Williams8ad44d52017-06-29 08:40:38 -070042 name: "docker>=2.4.2"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070043 state: present
44 tags: [docker]
45
46- name: Debian files are present
47 template:
48 src: "{{ docker_cfg }}"
49 dest: "{{ docker_cfg_dest }}"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070050 tags: [docker]
Zack Williamsdae7ff62016-11-14 15:20:06 -070051 notify:
52 - docker-restart
Zsolt Harasztiec7df102016-05-05 13:34:18 -070053
54- name: vagrant user is added to the docker group
55 user:
Andy Bavier3833dde2016-08-31 16:09:27 -040056 name: "{{ ansible_env['SUDO_USER'] }}"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070057 group: docker
Zsolt Harasztiec7df102016-05-05 13:34:18 -070058 tags: [docker]
Zack Williamsdae7ff62016-11-14 15:20:06 -070059 notify:
60 - docker-restart