0
0
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:
Georg Pfuetzenreuter 2023-11-14 02:55:32 +01:00 committed by Georg Pfuetzenreuter
parent 4254fa2b2c
commit 6317326515
No known key found for this signature in database
GPG Key ID: 1ED2F138E7E6FF57
46 changed files with 52 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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 %}

View File

@ -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

View File

@ -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

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3004'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -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

View File

@ -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

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3003'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3003'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3004'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3004'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -96,6 +96,7 @@ values:
python_git: GitPython
release: '3003'
restart_via_at: false
restart_via_systemd: false
retry_options:
attempts: 5
interval: 10

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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