-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_install.sls
31 lines (26 loc) · 967 Bytes
/
docker_install.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
{% if grains.os_family == 'RedHat' %}
{% set update = 'yum' %}
{% set keys = 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo' %}
{% set config = 'yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.33-1.git86f33cd.el7.noarch.rpm' %}
{% elif grains.os_family == 'Debian' %}
{% set update = 'apt' %}
{% set keys = 'curl -K -fsSL https://download.docker.com/linux/ubuntu/gpg >> text.txt | sudo apt-key add text.txt' %}
{% set config = 'add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"'%}
{% endif %}
Docker_key:
cmd.run:
- name: {{ keys }}
Docker_Repo:
cmd.run:
- name: {{ config }}
Update_Linux:
cmd.run:
- name: {{ update }} update
Install_Docker:
pkg.installed:
- name: docker-ce
Docker_Run:
service.running:
- name: docker
- require:
- pkg: docker-ce