Add debian_docker role
This commit is contained in:
parent
08ef92627e
commit
f6ccbbf5eb
4 changed files with 41 additions and 0 deletions
0
roles/debian_docker/defaults/main.yml
Normal file
0
roles/debian_docker/defaults/main.yml
Normal file
3
roles/debian_docker/files/daemon.json
Normal file
3
roles/debian_docker/files/daemon.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"log-driver": "journald"
|
||||
}
|
5
roles/debian_docker/handlers/main.yml
Normal file
5
roles/debian_docker/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Restart docker
|
||||
ansible.builtin.service:
|
||||
name: docker
|
||||
state: restarted
|
33
roles/debian_docker/tasks/main.yml
Normal file
33
roles/debian_docker/tasks/main.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
- name: Install Docker's GPG key in apt's keyring
|
||||
ansible.builtin.apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
state: present
|
||||
tags: docker install
|
||||
|
||||
- name: Setup Docker's apt repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
filename: docker
|
||||
tags: docker install
|
||||
|
||||
- name: Install Docker
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-compose-plugin
|
||||
state: present
|
||||
tags: docker install
|
||||
notify:
|
||||
- Restart docker
|
||||
|
||||
- name: Configure Docker daemon
|
||||
ansible.builtin.file:
|
||||
src: daemon.json
|
||||
dest: /etc/docker/daemon.json
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
Loading…
Reference in a new issue