You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
---
|
|
################################################################################
|
|
# Uninstall unwanted docker packages.
|
|
################################################################################
|
|
|
|
# https://docs.docker.com/engine/install/ubuntu/#uninstall-old-versions
|
|
- name: Remove old docker packages for Debian like distros.
|
|
apt:
|
|
name: "{{ docker_remove_old_packages[ansible_distribution] }}"
|
|
state: absent
|
|
become: true
|
|
|
|
################################################################################
|
|
# Install dependencies
|
|
################################################################################
|
|
|
|
# https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
|
|
- name: Install Docker dependencies on Debian like distro.
|
|
apt:
|
|
name:
|
|
- ca-certificates
|
|
- curl
|
|
- gnupg
|
|
- lsb-release
|
|
become: true
|
|
|
|
################################################################################
|
|
# Install docker repo.
|
|
################################################################################
|
|
|
|
# https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
|
|
- name: Add GPG key to apt for Ubuntu.
|
|
apt_key:
|
|
url: "{{ ubuntu_gpg_url }}"
|
|
id: "{{ ubuntu_gpg_fingerprint }}"
|
|
state: present
|
|
become: true
|
|
|
|
# https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
|
|
- name: Add Docker repository for Ubuntu.
|
|
apt_repository:
|
|
repo: "{{ ubuntu_apt_repo }}"
|
|
state: present
|
|
update_cache: true
|
|
become: true
|