-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerinstall.yml
59 lines (49 loc) · 1.19 KB
/
dockerinstall.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- hosts: "*"
become: yes
tasks:
- name: set up repository
apt:
name: "{{item}}"
state: present
update_cache: yes
loop:
- ca-certificates
- curl
- gnupg
- lsb-release
- name: Dockers official GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: add docker repository to apt
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu jammy stable
state: present
- name: install docker
apt:
name: "{{item}}"
state: latest
update_cache: yes
loop:
- docker-ce
- docker-ce-cli
- containerd.io
- name: check docker is active
service:
name: docker
state: started
enabled: yes
- name: Ensure group "docker" exists
ansible.builtin.group:
name: docker
state: present
- name: adding ubu to docker group
user:
name: ubu
groups: docker
append: yes
- name: install docker compose
apt:
name: docker-compose-plugin
state: latest
update_cache: yes