Files
states/softwares/dockerCE.sls

66 lines
1.5 KiB
Plaintext

{% if grains['os_family'] == 'RedHat' %}
{% 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
CentOS docker Service running:
service.running:
- name: docker
- enable: True
CentOS Docker Group:
group.present:
- name: docker
- addusers:
- iwan
{% 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
- lsb-release
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:
- name: docker
- enable: True
Debian Docker Group:
group.present:
- name: docker
- addusers:
- iwan
{% endif %}
{% endif %}