-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_docker_ubuntu.sls
48 lines (37 loc) · 995 Bytes
/
install_docker_ubuntu.sls
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
docker-package-dependencies:
pkg.installed:
- pkgs:
- apt-transport-https
- python-apt
- iptables
- ca-certificates
docker-package-repository:
pkgrepo.managed:
- name: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ salt['grains.get']('oscodename') }} stable
- key_url: https://download.docker.com/linux/ubuntu/gpg
docker-package:
pkg.installed:
- name: docker-ce
- version: latest
- pkgrepo: docker-package-repository
- refresh: True
- require:
- pkg: docker-package-dependencies
- pkgrepo: docker-package-repository
# Set Docker Config vis Daemon.json
set_daemon_json:
file.managed:
- name: /etc/docker/daemon.json
- source: salt://templates/daemon.json
docker-service:
service.running:
- name: docker
- enable: True
docker_py_requirements:
pkg.installed:
- name: python3-pip
- onlyif: True
docker-py:
pip.installed:
- name: docker
- reload_modules: true