Initialize ansible and docker web stuff

This commit is contained in:
2021-11-11 18:12:47 +01:00
commit 0e9e7732b2
14 changed files with 148 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# docker
Installs the Docker repositories and packages as described in [the Docker documentation](https://docs.docker.com/engine/install/debian/#install-using-the-repository).
Currently only works for Ubuntu since ubuntu is hardcoded into the `.list` file.
+38
View File
@@ -0,0 +1,38 @@
---
- name: Install Docker installation prerequisites
become: yes
apt:
update_cache: yes
state: latest
name:
- ca-certificates
- curl
- gnupg
- lsb-release
- name: Add Docker GPG key
become: yes
shell: "curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
args:
creates: /usr/share/keyrings/docker-archive-keyring.gpg
- name: Retrieve dpkg architecture
shell: dpkg --print-architecture
register: dpkg_architecture
changed_when: False
- name: Add Docker apt repository
become: yes
template:
src: docker.list.j2
dest: /etc/apt/sources.list.d/docker.list
- name: Install Docker
become: yes
apt:
update_cache: yes
state: latest
name:
- docker-ce
- docker-ce-cli
- containerd.io
@@ -0,0 +1 @@
deb [arch={{ dpkg_architecture.stdout }} signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable