Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linux): archlinux support & improvements #229

Merged
merged 1 commit into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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