| --- |
| # docker tasks/Debian.yml |
| # |
| # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| - name: Install apt related prereqs |
| apt: |
| name: |
| - "apt-transport-https" |
| - "ca-certificates" |
| - "gpg" |
| - "software-properties-common" |
| state: "present" |
| update_cache: true |
| |
| - name: Add Docker apt repo key |
| apt_key: |
| data: "{{ lookup('file','docker.gpg') }}" |
| state: "present" |
| |
| # https://docs.docker.com/engine/install/debian/#install-using-the-repository |
| - name: Add Official Docker apt repo |
| apt_repository: |
| repo: >- |
| deb https://download.docker.com/linux/{{ ansible_lsb['id'] | lower }} |
| {{ ansible_lsb['codename'] }} stable |
| mode: 0644 |
| update_cache: true |
| |
| - name: Install Docker daemon apt package |
| apt: |
| name: "{{ docker_package }}={{ docker_apt_epoch }}:{{ docker_version }}*" |
| state: "present" |
| update_cache: true |
| cache_valid_time: 3600 |
| |
| - name: Start and Enable Docker Service |
| service: |
| name: "{{ docker_service }}" |
| state: "started" |
| enabled: true |