mirror of
https://github.com/saltstack-formulas/salt-formula.git
synced 2026-03-02 13:14:38 +01:00
feat(suse): restart minion using systemd-run
The delayed restart using is a nice feature, but the "at" tool is outdated. Implement the same functionality using systemd-run and introduce a "restart_via_systemd" setting to toggle it. Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
parent
4254fa2b2c
commit
6317326515
@ -173,6 +173,8 @@ salt:
|
||||
|
||||
# salt minion config:
|
||||
minion_config_use_TOFS: true
|
||||
# schedule delayed minion restart on configuration changes
|
||||
restart_via_systemd: false
|
||||
minion:
|
||||
|
||||
# standalone setup
|
||||
|
||||
@ -11,6 +11,7 @@ salt:
|
||||
use_pip: false
|
||||
clean_config_d_dir: true
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
parallel: true # salt.git module argument
|
||||
|
||||
config_path: /etc/salt
|
||||
|
||||
@ -107,7 +107,7 @@ salt-minion:
|
||||
- file: remove-old-minion-conf-file
|
||||
- order: last
|
||||
{% endif %}
|
||||
{%- if not salt_settings.restart_via_at %}
|
||||
{%- if not salt_settings.restart_via_at and not salt_settings.restart_via_systemd %}
|
||||
cmd.run:
|
||||
{%- if grains['saltversioninfo'] >= [ 2016, 3 ] %}
|
||||
{%- if grains['kernel'] == 'Windows' %}
|
||||
@ -142,7 +142,7 @@ salt-minion:
|
||||
- file: remove-old-minion-conf-file
|
||||
{%- else %}
|
||||
|
||||
{% if grains.os_family not in ['MacOS', 'FreeBSD'] %}
|
||||
{%- if grains.os_family not in ['MacOS', 'FreeBSD'] and not salt_settings.restart_via_systemd %}
|
||||
{# MacOS and FreeBSD have the 'at' command; but there's no package to install #}
|
||||
at:
|
||||
pkg.installed:
|
||||
@ -151,7 +151,11 @@ at:
|
||||
|
||||
restart-salt-minion:
|
||||
cmd.run:
|
||||
{%- if salt_settings.restart_via_systemd %}
|
||||
- name: systemd-run --on-active=1m systemctl restart salt-minion
|
||||
{%- else %}
|
||||
- name: echo salt-call --local service.restart {{ salt_settings.minion_service }} | at now + 1 minute
|
||||
{%- endif %}
|
||||
- order: last
|
||||
- onchanges:
|
||||
{%- if salt_settings.install_packages %}
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_git: python2-gitpython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -97,6 +97,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -97,6 +97,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -93,6 +93,7 @@ values:
|
||||
python_git: py39-gitpython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -93,6 +93,7 @@ values:
|
||||
python_git: py39-gitpython
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -93,6 +93,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -93,6 +93,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: py3-GitPython
|
||||
release: '3002'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: py3-GitPython
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -96,6 +96,7 @@ values:
|
||||
python_git: GitPython
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -95,6 +95,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: GitPython
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -99,6 +99,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -98,6 +98,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -98,6 +98,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -98,6 +98,7 @@ values:
|
||||
python_dulwich: python-dulwich
|
||||
python_git: python-git
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3003'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
@ -92,6 +92,7 @@ values:
|
||||
python_git: python-git
|
||||
release: '3004'
|
||||
restart_via_at: false
|
||||
restart_via_systemd: false
|
||||
retry_options:
|
||||
attempts: 5
|
||||
interval: 10
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user