Salt: support systemd (don't assume Redhat <=> systemd)

Also work around problems with Salt & systemd services, in particular
that Salt doesn't issue a daemon-reload.
This commit is contained in:
Justin Santa Barbara
2015-06-29 14:17:17 -04:00
parent 974377b306
commit bcd92c7522
17 changed files with 264 additions and 77 deletions

View File

@@ -112,13 +112,17 @@ addon-dir-create:
- group: root
- mode: 755
{% if grains['os_family'] == 'RedHat' %}
{% if pillar.get('is_systemd') %}
/usr/lib/systemd/system/kube-addons.service:
{{ pillar.get('systemd_system_path') }}/kube-addons.service:
file.managed:
- source: salt://kube-addons/kube-addons.service
- user: root
- group: root
cmd.wait:
- name: /opt/kubernetes/helpers/services bounce kube-addons
- watch:
- file: {{ pillar.get('systemd_system_path') }}/kube-addons.service
{% else %}
@@ -129,8 +133,6 @@ addon-dir-create:
- group: root
- mode: 755
{% endif %}
# Stop kube-addons service each time salt is executed, just in case
# there was a modification of addons.
# Actually, this should be handled by watching file changes, but
@@ -144,3 +146,5 @@ kube-addons:
- enable: True
- require:
- service: service-kube-addon-stop
{% endif %}