-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.yaml
65 lines (57 loc) · 1.52 KB
/
docker.yaml
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
60
61
62
63
64
65
---
- name: Install docker on Ubuntu
hosts: localhost
become: true
tasks:
- name: install dependencies
apt:
name: "{{item}}"
state: present
update_cache: yes
loop:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: adding GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: adding docker repo to apt
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: installing docker
apt:
name: "{{item}}"
state: latest
update_cache: yes
loop:
- docker-ce
- docker-ce-cli
- containerd.io
- name: starting and enabling docker service
service:
name: docker
state: started
enabled: yes
- name: creating docker group
ansible.builtin.group:
name: docker
state: present
- name: adding niksihora to docker group
user:
name: niksihora
groups: docker
append: yes
- name: Installing docker-compose
get_url:
url: https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
mode: 'u+x,g+x'
- name: seting file permissions
ansible.builtin.file:
path: /usr/local/bin/docker-compose
owner: root
group: docker