blob: 987997994e9309a55d79f35db7382181ce58037c [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 Williams642388d2017-04-12 22:39:15 -070017---
18
19- name: Prereqs and SSL support for apt for SSL
David K. Bainbridge317e7d72016-05-11 08:31:44 -070020 become: yes
Zack Williams642388d2017-04-12 22:39:15 -070021 apt:
22 name: "{{ item }}"
23 update_cache: yes
24 cache_valid_time: 3600
David K. Bainbridge317e7d72016-05-11 08:31:44 -070025 with_items:
Zack Williams642388d2017-04-12 22:39:15 -070026 - apt-transport-https
27 - ca-certificates
28 - python-pip
David K. Bainbridge317e7d72016-05-11 08:31:44 -070029
30- name: Docker Apt Key
31 become: yes
32 apt_key:
Zack Williams642388d2017-04-12 22:39:15 -070033 data: "{{ lookup('file', 'docker_apt_key.gpg') }}"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070034
35- name: Docker repository
36 become: yes
37 apt_repository:
Zack Williams642388d2017-04-12 22:39:15 -070038 repo: "{{ docker_apt_repo }}"
David K. Bainbridge317e7d72016-05-11 08:31:44 -070039
Zack Williams6fe46372017-06-29 08:30:21 -070040- name: Install docker-ce
David K. Bainbridge317e7d72016-05-11 08:31:44 -070041 become: yes
42 apt:
Zack Williams6fe46372017-06-29 08:30:21 -070043 name: "docker-ce=17.06.*"
Zack Williams642388d2017-04-12 22:39:15 -070044 update_cache: yes
45 cache_valid_time: 3600
David K. Bainbridge317e7d72016-05-11 08:31:44 -070046
Zack Williams642388d2017-04-12 22:39:15 -070047# docker fails without docker-py, docker-compose >1.9 fails with docker-py installed
Andy Baviere72d83d2017-06-14 17:28:30 -070048- name: Install docker-compose
Zack Williams642388d2017-04-12 22:39:15 -070049 become: yes
50 pip:
51 name: "{{ item }}"
52 with_items:
Zack Williams6fe46372017-06-29 08:30:21 -070053 - "docker==2.4.2"
Zack Williams0e4fd662017-09-01 11:10:23 -070054 - "docker-compose==1.15.0"
Zack Williams642388d2017-04-12 22:39:15 -070055
56- name: Make current user part of the Docker group
David K. Bainbridge2a804222016-05-16 12:36:32 -070057 become: yes
58 user:
Zack Williams642388d2017-04-12 22:39:15 -070059 name: "{{ ansible_user_id }}"
60 groups: "docker"
61 append: yes
David K. Bainbridge2a804222016-05-16 12:36:32 -070062