2
0

Merge pull request #339 from dafyddj/win-restart

Fix Windows minion restart command
This commit is contained in:
Niels Abspoel 2017-12-23 11:41:06 +01:00 committed by GitHub
commit 31e2d95203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,11 +22,11 @@ salt-minion:
cmd.run: cmd.run:
{%- if grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 %} {%- if grains['saltversioninfo'][0] >= 2016 and grains['saltversioninfo'][1] >= 3 %}
{%- if grains['kernel'] == 'Windows' %} {%- if grains['kernel'] == 'Windows' %}
- name: '{{ salt_settings.config_path }}\salt-call.bat --local service.restart {{ salt_settings.minion_service }}' - name: 'salt-call.bat --local service.restart {{ salt_settings.minion_service }}'
{%- else %} {%- else %}
- name: 'salt-call --local service.restart {{ salt_settings.minion_service }} --out-file /dev/null' - name: 'salt-call --local service.restart {{ salt_settings.minion_service }} --out-file /dev/null'
- bg: True
{%- endif %} {%- endif %}
- bg: True
{%- else %} {%- else %}
{%- if grains['kernel'] == 'Windows' %} {%- if grains['kernel'] == 'Windows' %}
- name: 'start powershell "Restart-Service -Name {{ salt_settings.minion_service }}"' - name: 'start powershell "Restart-Service -Name {{ salt_settings.minion_service }}"'