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:
@@ -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 %}
|
||||
|
Reference in New Issue
Block a user