Matteo Scandolo | 60b640f | 2017-08-08 13:05:22 -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 | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 17 | --- |
| 18 | |
Luca Prete | c15c649 | 2017-02-17 11:28:10 -0800 | [diff] [blame] | 19 | - name: Trust docker apt key |
| 20 | apt_key: |
| 21 | data={{ lookup('file', 'docker_apt_key.gpg') }} |
| 22 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 23 | - name: Debian add Docker repository and update apt cache |
| 24 | apt_repository: |
Zack Williams | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 25 | repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 26 | update_cache: yes |
| 27 | state: present |
| 28 | tags: [docker] |
| 29 | |
Zack Williams | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 30 | - name: Install docker-ce using apt |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 31 | apt: |
Zack Williams | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 32 | name: docker-ce=17.06.* |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 33 | force: yes |
David K. Bainbridge | f5ffb0d | 2016-11-04 16:14:54 +0100 | [diff] [blame] | 34 | tags: [docker, skip_ansible_lint] |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 35 | |
| 36 | - name: Debian python-pip is present |
| 37 | apt: name=python-pip state=present |
| 38 | tags: [docker] |
| 39 | |
Zack Williams | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 40 | - name: docker python package present |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 41 | pip: |
Zack Williams | 8ad44d5 | 2017-06-29 08:40:38 -0700 | [diff] [blame] | 42 | name: "docker>=2.4.2" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 43 | state: present |
| 44 | tags: [docker] |
| 45 | |
| 46 | - name: Debian files are present |
| 47 | template: |
| 48 | src: "{{ docker_cfg }}" |
| 49 | dest: "{{ docker_cfg_dest }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 50 | tags: [docker] |
Zack Williams | dae7ff6 | 2016-11-14 15:20:06 -0700 | [diff] [blame] | 51 | notify: |
| 52 | - docker-restart |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 53 | |
| 54 | - name: vagrant user is added to the docker group |
| 55 | user: |
Andy Bavier | 3833dde | 2016-08-31 16:09:27 -0400 | [diff] [blame] | 56 | name: "{{ ansible_env['SUDO_USER'] }}" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 57 | group: docker |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 58 | tags: [docker] |
Zack Williams | dae7ff6 | 2016-11-14 15:20:06 -0700 | [diff] [blame] | 59 | notify: |
| 60 | - docker-restart |