Explorar el Código

Add restart minion via at (fixes #136)

master
a.genus hace 7 años
padre
commit
22ad7db7c0
Se han modificado 2 ficheros con 21 adiciones y 2 borrados
  1. +1
    -0
      salt/defaults.yaml
  2. +20
    -2
      salt/minion.sls

+ 1
- 0
salt/defaults.yaml Ver fichero

@@ -4,6 +4,7 @@ salt:
install_packages: True
use_pip: False
clean_config_d_dir: True
restart_via_at: False

config_path: /etc/salt


+ 20
- 2
salt/minion.sls Ver fichero

@@ -16,12 +16,30 @@ salt-minion:
service.running:
- enable: True
- name: {{ salt_settings.minion_service }}
{%- if not salt_settings.restart_via_at %}
- watch:
{% if salt_settings.install_packages %}
{%- if salt_settings.install_packages %}
- pkg: salt-minion
{% endif %}
{%- endif %}
- file: salt-minion
- file: remove-old-minion-conf-file
{%- else %}
at:
pkg.installed: []

restart-salt-minion:
cmd.wait:
- name: echo salt-call --local service.restart salt-minion | at now + 1 minute
- order: last
- reqiure:
- pkg: at
- watch:
{%- if salt_settings.install_packages %}
- pkg: salt-minion
{%- endif %}
- file: salt-minion
- file: remove-old-minion-conf-file
{%- endif %}

{% if salt_settings.minion_remove_config %}
remove-default-minion-conf-file:

Cargando…
Cancelar
Guardar