Skip to content

Commit

Permalink
feat(linux): archlinux support (saltstack-formulas#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin authored and aboe76 committed Aug 17, 2019
1 parent 3a637c7 commit 71ee3c4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker/compose.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker-compose:
- name: /usr/bin/pip install docker-compose
{%- else %}
pip.installed:
{%- if docker.compose_version %}
{%- if 'compose_version' in docker and docker.compose_version %}
- name: docker-compose == {{ docker.compose_version }}
{%- else %}
- name: docker-compose
Expand Down
1 change: 0 additions & 1 deletion docker/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ docker:
pkgs:
- iptables
- ca-certificates
- python3-docker

pkg:
name: docker-ce
Expand Down
23 changes: 19 additions & 4 deletions docker/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ docker-package:
{%- if grains.os_family in ('Suse',) %} ##workaround https://github.com/saltstack-formulas/docker-formula/issues/198
cmd.run:
- name: /usr/bin/pip install {{ '--upgrade' if docker.pip.upgrade else '' }} pip
{%- else %}
{%- elif docker.pip.install_pypi_pip %} ##onlyif you really need pypi pip instead of using official distro pip
pip.installed:
- name: pip
- reload_modules: true
- upgrade: {{ docker.pip.upgrade }}
{%- endif %}
- onlyif: {{ docker.pip.install_pypi_pip }} #### onlyif you really need pypi pip instead of using official distro pip.
- require:
- pkg: docker-package-dependencies
Expand Down Expand Up @@ -95,16 +94,32 @@ docker-service:
- sig: {{ docker.process_signature }}
{% endif %}
docker-install-docker-service-not-running-notify:
test.show_notification:
- text: |
In certain circumstances the docker service will not start.
Your kernel is missing some modules, or not in ideal state.
See https://github.com/moby/moby/blob/master/contrib/check-config.sh
Rebooting your host may fix docker service failure!
- onfail:
- service: docker-service
- unless: {{ grains.os_family in ('MacOS', 'Windows') }} #maybe not needed?
service.enabled:
- name: docker
- onfail:
- service: docker-service
- unless: {{ grains.os_family in ('MacOS', 'Windows') }} #maybe not needed?
{% if docker.install_docker_py %}
docker-py:
{%- if grains.os_family in ('Suse',) %} ##workaround https://github.com/saltstack-formulas/docker-formula/issues/198
cmd.run:
- name: /usr/bin/pip install {{ docker.python_package }}
{%- else %}
pip.installed:
{%- if "python_package" in docker %}
{%- if "python_package" in docker and docker.python_package %}
- name: {{ docker.python_package }}
{%- elif "pip_version" in docker %}
{%- elif "pip_version" in docker and docker.pip_version %}
- name: docker-py {{ docker.pip_version }}
{%- else %}
- name: docker-py
Expand Down
26 changes: 24 additions & 2 deletions docker/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@
{% set macos_user = salt['cmd.run']("stat -f '%Su' /dev/console") %}
{%- endif %}

Arch:
python_package:
pkgs:
- python-docker
- python-pip
- python2-pip ##see https://github.com/saltstack/salt/issues/48632
pkg:
name: docker
# workaround https://github.com/saltstack-formulas/docker-formula/issues/219
allow_updates: False
hold: False
use_upstream_app: False
pip:
install_pypi_pip: False
upgrade: False

Debian:
pkgs:
- apt-transport-https
- python3-apt
- python3-pip
- python3-docker
repo:
url_base: https://download.docker.com/linux/{{ grains['os'] |lower }}
key_url: https://download.docker.com/linux/{{ grains['os'] |lower }}/gpg
Expand All @@ -28,8 +45,9 @@ Debian:
RedHat:
pkgs:
- python3-pip
- python3-docker
repo:
url_base: https://download.docker.com/linux/{{ grains['os'] |lower }}/{{ grains['osmajorrelease'] }}/$basearch/stable/
url_base: https://download.docker.com/linux/{{ grains['os'] |lower }}/{{ '' if not 'osmajorrelease' in grains else grains['osmajorrelease'] }}/$basearch/stable/
key_url: https://download.docker.com/linux/{{ grains['os'] |lower }}/gpg
version: {{ grains['oscodename']|lower if 'oscodename' in grains else '' }}
file: /etc/yum.repos.d/docker-ce.repo
Expand All @@ -39,15 +57,19 @@ Suse:
name: docker
pkgs:
- python3-pip
- python3-docker

MacOS:
rootuser: {{ macos_user | d('') }}
pkgs:
- python3-docker
pkg:
name: docker #homebrew
# workaround https://github.com/saltstack-formulas/docker-formula/issues/219
allow_updates: False
hold: False
use_upstream_app: True #docker desktop for mac
app:
name: Docker
source: https://download.docker.com/mac/stable/Docker.dmg
source_hash: a55462f153284ff212f8857945a69d4e128afb6753f5572984877f7b6fc3fc25
source_hash: a55462f153284ff212f8857945a69d4e128afb6753f5572984877f7b6fc3fc25

0 comments on commit 71ee3c4

Please sign in to comment.