Reorganisation installation Docker
This commit is contained in:
21
softwares/dockerCE-Centos.sls
Normal file
21
softwares/dockerCE-Centos.sls
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
|
{% if grains['os'] == 'CentOS' %}
|
||||||
|
CentOS Docker PreRequisites:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- yum-utils
|
||||||
|
- device-mapper-persistent-data
|
||||||
|
- lvm2
|
||||||
|
|
||||||
|
CentOS Docker Add Repo:
|
||||||
|
cmd.run:
|
||||||
|
- name: yum-config-manager -y --add-repo 'https://download.docker.com/linux/centos/docker-ce.repo'
|
||||||
|
|
||||||
|
CentOS Docker CE installation:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- docker-ce
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
13
softwares/dockerCE-Common.sls
Normal file
13
softwares/dockerCE-Common.sls
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
|
Docker Service running:
|
||||||
|
service.running:
|
||||||
|
- name: docker
|
||||||
|
- enable: True
|
||||||
|
|
||||||
|
Docker Group:
|
||||||
|
group.present:
|
||||||
|
- name: docker
|
||||||
|
- addusers:
|
||||||
|
- iwan
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
26
softwares/dockerCE-Debian.sls
Normal file
26
softwares/dockerCE-Debian.sls
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
|
{% if grains['os'] == 'Debian' %}
|
||||||
|
Debian Docker PreRequisites:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg2
|
||||||
|
|
||||||
|
{% set DEBVER = salt['grains.get']('oscodename') %}
|
||||||
|
Debian Docker Add Repo:
|
||||||
|
pkgrepo.managed:
|
||||||
|
- name: deb [arch=amd64] https://download.docker.com/linux/debian {{DEBVER}} stable
|
||||||
|
- file: /etc/apt/sources.list.d/docker-ce.list
|
||||||
|
- enable: 1
|
||||||
|
- key_url: https://download.docker.com/linux/debian/gpg
|
||||||
|
|
||||||
|
Debian Docker CE installation:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- docker-ce
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
10
softwares/dockerCE-Fedora.sls
Normal file
10
softwares/dockerCE-Fedora.sls
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
|
{% if grains['os'] == 'Fedora' %}
|
||||||
|
Fedora Docker installation:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- docker
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
26
softwares/dockerCE-Ubuntu.sls
Normal file
26
softwares/dockerCE-Ubuntu.sls
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
|
{% elif grains['os'] == 'Ubuntu' %}
|
||||||
|
{% set UBUVER = salt['grains.get']('oscodename') %}
|
||||||
|
Ubuntu Docker PreRequisites:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg2
|
||||||
|
|
||||||
|
Ubuntu Docker Add Repo:
|
||||||
|
pkgrepo.managed:
|
||||||
|
- name: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{UBUVER}} stable
|
||||||
|
- file: /etc/apt/sources.list.d/docker-ce.list
|
||||||
|
- enable: 1
|
||||||
|
- key_url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
|
|
||||||
|
Ubuntu Docker CE installation:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- docker-ce
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
@@ -1,100 +1,8 @@
|
|||||||
{% if grains['kernel'] == 'Linux' %}
|
{% if grains['kernel'] == 'Linux' %}
|
||||||
{% if grains['os_family'] == 'RedHat' %}
|
include:
|
||||||
{% if grains['os'] == 'CentOS' %}
|
- softwares.dockerCE-Centos
|
||||||
CentOS Docker PreRequisites:
|
- softwares.dockerCE-Fedora
|
||||||
pkg.installed:
|
- softwares.dockerCE-Debian
|
||||||
- pkgs:
|
- softwares.dockerCE-Ubuntu
|
||||||
- yum-utils
|
- softwares.dockerCE-Common
|
||||||
- device-mapper-persistent-data
|
|
||||||
- lvm2
|
|
||||||
|
|
||||||
CentOS Docker Add Repo:
|
|
||||||
cmd.run:
|
|
||||||
- name: yum-config-manager -y --add-repo 'https://download.docker.com/linux/centos/docker-ce.repo'
|
|
||||||
|
|
||||||
CentOS Docker CE installation:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- docker-ce
|
|
||||||
- docker-compose
|
|
||||||
|
|
||||||
{% elif grains['os'] == 'Fedora' %}
|
|
||||||
Fedora Docker installation:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- docker
|
|
||||||
- docker-compose
|
|
||||||
|
|
||||||
Fedora docker Service running:
|
|
||||||
service.running:
|
|
||||||
- name: docker
|
|
||||||
- enable: True
|
|
||||||
|
|
||||||
Fedora Docker Group:
|
|
||||||
group.present:
|
|
||||||
- name: docker
|
|
||||||
- addusers:
|
|
||||||
- iwan
|
|
||||||
{% endif %}
|
|
||||||
{% elif grains['os_family'] == 'Debian' %}
|
|
||||||
Debian Docker PreRequisites:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- apt-transport-https
|
|
||||||
- ca-certificates
|
|
||||||
- curl
|
|
||||||
- gnupg2
|
|
||||||
|
|
||||||
{% if grains['os'] == 'Debian' %}
|
|
||||||
{% set DEBVER = salt['grains.get']('oscodename') %}
|
|
||||||
Debian Docker Add Repo:
|
|
||||||
pkgrepo.managed:
|
|
||||||
- name: deb [arch=amd64] https://download.docker.com/linux/debian {{DEBVER}} stable
|
|
||||||
- file: /etc/apt/sources.list.d/docker-ce.list
|
|
||||||
- enable: 1
|
|
||||||
- key_url: https://download.docker.com/linux/debian/gpg
|
|
||||||
|
|
||||||
Debian Docker CE installation:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- docker-ce
|
|
||||||
- docker-compose
|
|
||||||
|
|
||||||
{% elif grains['os'] == 'Ubuntu' %}
|
|
||||||
{% if grains['osrelease'] == '18.04' %}
|
|
||||||
Ubuntu Docker Install Ubuntu 18.04:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- docker
|
|
||||||
- docker-compose
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
{% set UBUVER = salt['grains.get']('oscodename') %}
|
|
||||||
Ubuntu Docker Add Repo:
|
|
||||||
pkgrepo.managed:
|
|
||||||
- name: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{UBUVER}} stable
|
|
||||||
- file: /etc/apt/sources.list.d/docker-ce.list
|
|
||||||
- enable: 1
|
|
||||||
- key_url: https://download.docker.com/linux/ubuntu/gpg
|
|
||||||
|
|
||||||
Ubuntu Docker CE installation:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- docker-ce
|
|
||||||
- docker-compose
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
Docker Service running:
|
|
||||||
service.running:
|
|
||||||
- name: docker
|
|
||||||
- enable: True
|
|
||||||
|
|
||||||
Docker Group:
|
|
||||||
group.present:
|
|
||||||
- name: docker
|
|
||||||
- addusers:
|
|
||||||
- iwan
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user