Zack Williams | e0d9eb9 | 2020-11-29 22:39:20 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # docker tasks/Debian.yml |
| 3 | # |
| 4 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | - name: Install apt related prereqs |
| 8 | apt: |
| 9 | name: |
| 10 | - "apt-transport-https" |
| 11 | - "ca-certificates" |
| 12 | - "gpg" |
| 13 | - "software-properties-common" |
| 14 | state: "present" |
| 15 | update_cache: true |
| 16 | |
| 17 | - name: Add Docker apt repo key |
| 18 | apt_key: |
| 19 | data: "{{ lookup('file','docker.gpg') }}" |
| 20 | state: "present" |
| 21 | |
| 22 | # https://docs.docker.com/engine/install/debian/#install-using-the-repository |
| 23 | - name: Add Official Docker apt repo |
| 24 | apt_repository: |
| 25 | repo: >- |
| 26 | deb https://download.docker.com/linux/{{ ansible_lsb['id'] | lower }} |
| 27 | {{ ansible_lsb['codename'] }} stable |
| 28 | mode: 0644 |
| 29 | update_cache: true |
| 30 | |
| 31 | - name: Install Docker daemon apt package |
| 32 | apt: |
| 33 | name: "{{ docker_package }}={{ docker_apt_epoch }}:{{ docker_version }}*" |
| 34 | state: "present" |
| 35 | update_cache: true |
| 36 | cache_valid_time: 3600 |
| 37 | |
| 38 | - name: Start and Enable Docker Service |
| 39 | service: |
| 40 | name: "{{ docker_service }}" |
| 41 | state: "started" |
| 42 | enabled: true |