This commit is contained in:
2024-05-06 15:20:57 +02:00
parent 6a2fbcee07
commit 1ef3dd3c83
21 changed files with 487 additions and 0 deletions

View File

@ -0,0 +1,41 @@
---
- name: Ensure apt is using HTTPS
ansible.builtin.apt:
name: "{{ item }}"
state: present
loop:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- name: Add Docker GPG key
ansible.builtin.apt_key:
url: "https://download.docker.com/linux/ubuntu/gpg"
state: present
- name: Add Docker repository
ansible.builtin.apt_repository:
repo: "{{ docker_apt_repository }}"
state: present
- name: Install Docker CE
ansible.builtin.apt:
name: docker-ce
state: present
update_cache: true
- name: Configure Docker daemon options
ansible.builtin.template:
src: "templates/docker_daemon.json.j2"
dest: "/etc/docker/daemon.json"
owner: 'root'
group: 'root'
mode: '0755' # Optional file permissions
notify: Restart Docker
- name: Ensure Docker service is enabled and running
ansible.builtin.systemd:
name: docker
enabled: true
state: started