Installation de Docker CE sur CentOS et Debian

This commit is contained in:
2018-04-28 10:11:29 +02:00
parent 00eef68ae6
commit def71088c3

View File

@@ -1,23 +1,50 @@
{% if grains['os_family'] == 'RedHat' %} {% if grains['os_family'] == 'RedHat' %}
{% if grains['os'] == 'CentOS' %} {% if grains['os'] == 'CentOS' %}
Docker PreRequisites: CentOS Docker PreRequisites:
pkg.installed: pkg.installed:
- pkgs: - pkgs:
- yum-utils - yum-utils
- device-mapper-persistent-data - device-mapper-persistent-data
- lvm2 - lvm2
Docker Add Repo: CentOS Docker Add Repo:
cmd.run: cmd.run:
- name: yum-config-manager -y --add-repo 'https://download.docker.com/linux/centos/docker-ce.repo' - name: yum-config-manager -y --add-repo 'https://download.docker.com/linux/centos/docker-ce.repo'
Docker CE installation: CentOS Docker CE installation:
pkg.installed: pkg.installed:
- pkgs: - pkgs:
- docker-ce - docker-ce
docker: CentOS docker Service running:
service.running: service.running:
- enable: True - enable: True
{% endif %}
{% elif grains['os_family'] == 'Debian' %}
{% if grains['os'] == 'Debian' %}
Debian Docker PreRequisites:
pkg.installed:
- pkgs:
- apt-transport-https
- ca-certificates
- curl
- gnupg2
- software-properties-common
Debian Docker Add Repo:
cmd.run:
-name: curl -fsSL 'https://download.docker.com/linux/debian/gpg' | apt-key -y add -
-name: add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb-release -cs) stable"
Debian Docker CE installation:
pkg.installed:
- pkgs:
- docker-ce
Debian docker Service running:
service.running:
- enable: True
{% endif %} {% endif %}
{% endif %} {% endif %}