Jonathan Hart | 93956f5 | 2017-08-22 13:12:42 -0700 | [diff] [blame] | 1 | |
| 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 Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 17 | --- |
| 18 | |
| 19 | - name: Prereqs and SSL support for apt for SSL |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 20 | become: yes |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 21 | apt: |
| 22 | name: "{{ item }}" |
| 23 | update_cache: yes |
| 24 | cache_valid_time: 3600 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 25 | with_items: |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 26 | - apt-transport-https |
| 27 | - ca-certificates |
| 28 | - python-pip |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 29 | |
| 30 | - name: Docker Apt Key |
| 31 | become: yes |
| 32 | apt_key: |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 33 | data: "{{ lookup('file', 'docker_apt_key.gpg') }}" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 34 | |
| 35 | - name: Docker repository |
| 36 | become: yes |
| 37 | apt_repository: |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 38 | repo: "{{ docker_apt_repo }}" |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 39 | |
Zack Williams | 6fe4637 | 2017-06-29 08:30:21 -0700 | [diff] [blame] | 40 | - name: Install docker-ce |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 41 | become: yes |
| 42 | apt: |
Zack Williams | 6fe4637 | 2017-06-29 08:30:21 -0700 | [diff] [blame] | 43 | name: "docker-ce=17.06.*" |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 44 | update_cache: yes |
| 45 | cache_valid_time: 3600 |
David K. Bainbridge | 317e7d7 | 2016-05-11 08:31:44 -0700 | [diff] [blame] | 46 | |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 47 | # docker fails without docker-py, docker-compose >1.9 fails with docker-py installed |
Andy Bavier | ad44c16 | 2017-06-14 17:28:30 -0700 | [diff] [blame^] | 48 | - name: Install docker-compose |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 49 | become: yes |
| 50 | pip: |
| 51 | name: "{{ item }}" |
| 52 | with_items: |
Zack Williams | 6fe4637 | 2017-06-29 08:30:21 -0700 | [diff] [blame] | 53 | - "docker==2.4.2" |
Zack Williams | 0e4fd66 | 2017-09-01 11:10:23 -0700 | [diff] [blame] | 54 | - "docker-compose==1.15.0" |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 55 | |
| 56 | - name: Make current user part of the Docker group |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 57 | become: yes |
| 58 | user: |
Zack Williams | 642388d | 2017-04-12 22:39:15 -0700 | [diff] [blame] | 59 | name: "{{ ansible_user_id }}" |
| 60 | groups: "docker" |
| 61 | append: yes |
David K. Bainbridge | 2a80422 | 2016-05-16 12:36:32 -0700 | [diff] [blame] | 62 | |