Salt: bypass Salt when installing docker package on debian

The Docker 1.9.1 package on Debian is broken, and the service fails to
install when run unattended.  This is treated as an installation failure
and causes everything to fail.

However, the service can be started by Salt once we're not installing
the package, and indeed we restart docker anyway.

So, on Debian, use a helper script to install the docker package.  The
script sets up a policy-rc.d file to prevent the service starting, and
then cleanly removes it afterwards (this would be difficult to do in
Salt, I believe).
This commit is contained in:
Justin Santa Barbara
2016-02-24 09:39:50 -05:00
parent 5f553a218e
commit 4ce0f8ccec
3 changed files with 85 additions and 7 deletions

View File

@@ -276,9 +276,8 @@ purge-old-docker-package:
- makedirs: true
docker-upgrade:
pkg.installed:
- sources:
- {{ docker_pkg_name }}: /var/cache/docker-install/{{ override_deb }}
cmd.run:
- name: /opt/kubernetes/helpers/pkg install-no-start {{ docker_pkg_name }} {{ override_docker_ver }} /var/cache/docker-install/{{ override_deb }}
- require:
- file: /var/cache/docker-install/{{ override_deb }}
{% endif %} # end override_docker_ver != ''
@@ -308,7 +307,7 @@ fix-service-docker:
- file: {{ environment_file }}
{% if override_docker_ver != '' %}
- require:
- pkg: docker-upgrade
- cmd: docker-upgrade
{% endif %}
{% endif %}
@@ -327,14 +326,14 @@ docker:
- watch:
- file: {{ environment_file }}
{% if override_docker_ver != '' %}
- pkg: docker-upgrade
- cmd: docker-upgrade
{% endif %}
{% if pillar.get('is_systemd') %}
- file: {{ pillar.get('systemd_system_path') }}/docker.service
{% endif %}
{% if override_docker_ver != '' %}
- require:
- pkg: docker-upgrade
- cmd: docker-upgrade
{% endif %}
{% endif %} # end grains.os_family != 'RedHat'