-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7658261
commit 6bea939
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
# Based on the offical docker documentation on https://docs.docker.com/engine/install/ubuntu/ | ||
|
||
- name: "Ensure dependencies are installed" | ||
ansible.builtin.apt: | ||
name: | ||
- "ca-certificates" | ||
- "curl" | ||
state: "present" | ||
|
||
- name: "Add Docker apt key" | ||
ansible.builtin.apt_key: | ||
url: "https://download.docker.com/linux/ubuntu/gpg" | ||
id: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88" | ||
state: "present" | ||
# NOTE: this differs from the official documentation, as it does not install the keyring to /etc/apt/keyrings | ||
|
||
- name: "Add Docker repository" | ||
ansible.builtin.apt_repository: | ||
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" | ||
state: "present" | ||
update_cache: true | ||
# NOTE: this differs from the official documentation, as it does not echo the string to /etc/apt/ as 'docker.list' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
# FIXME docker exposed ports bypass ufw firefwall, which we use. | ||
# See https://docs.docker.com/network/packet-filtering-firewalls/#docker-and-ufw | ||
|
||
- name: "Install Docker" | ||
block: | ||
|
||
- name: "Add Docker apt repository" | ||
ansible.builtin.include_tasks: "docker-apt-repo.yml" | ||
|
||
- name: "Install Docker packages" | ||
ansible.builtin.package: | ||
name: | ||
- "docker-ce={{ docker_engine_version }}" | ||
- "docker-ce-cli={{ docker_engine_version }}" | ||
- "containerd.io" | ||
- "docker-buildx-plugin" | ||
state: "present" | ||
|
||
- name: "Ensure Docker is started and enabled at boot" | ||
ansible.builtin.service: | ||
name: "docker" | ||
state: "started" | ||
enabled: true | ||
|
||
- name: "Install Docker Compose" | ||
ansible.builtin.package: | ||
name: "docker-compose-plugin" | ||
state: "present" | ||
|
||
- name: "Ensure admin users are added to the docker group" | ||
ansible.builtin.user: | ||
name: "{{ item.name }}" | ||
groups: "docker" | ||
append: true | ||
with_items: "{{ users }}" | ||
when: "item.admin" | ||
loop_control: | ||
label: "Adding '{{ item.name }}' to the docker group" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
# Possible docker engine versions can be obtained through the following | ||
# command: apt-cache madison docker-ce | awk '{ print $3 }' | ||
docker_engine_version: "5:27.0.3-1~ubuntu.20.04~focal" |