-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_docker.yaml
40 lines (36 loc) · 1.21 KB
/
install_docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- name: Install Docker from Docker repo
hosts: azure
become: true
tasks:
- name: Install ca-certificates and curl
ansible.builtin.apt:
pkg:
- ca-certificates
- curl
- name: Add key to keyring
ansible.builtin.command:
cmd: install -m 0755 -d /etc/apt/keyrings
register: create_keyring_folder
changed_when: create_keyring_folder.rc != 0
- name: Curl repo link
ansible.builtin.get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/keyrings/docker.asc
mode: "a+r"
- name: Add the repository to Apt sources
ansible.builtin.shell: |
set -o pipefail
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- name: Install the Docker packages
ansible.builtin.apt:
update_cache: true
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present