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