* Those patch enable salt-(minion|master|api) services daemon auto-restart, in case any unclear exit will be detected. Systemd will try to run service each 3sec, till _StartLimitBurst_ limit will not be reached. (default 5) * Migrate systemd_minion_override.conf file * Duplicate patch for minion in base.sls and in service.sls Change-Id: I65f35f1c50935af5692b740bb75ba0a629b18c48 Closes-Bug: PROD-23969 (PROD:23969)master
@@ -26,15 +26,29 @@ salt_api_init_tls: | |||
- creates: /etc/ssl/certs/{{ api.ssl.get('name', grains.id) }}-chain.crt | |||
- watch_in: | |||
- service: salt_api_service | |||
{%- endif %} | |||
salt_api_service: | |||
service.running: | |||
- name: salt-api | |||
- name: {{ api.service }} | |||
- require: | |||
- pkg: salt_api_packages | |||
- watch: | |||
- file: /etc/salt/master.d/_api.conf | |||
{%- endif %} | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
salt_api_systemd_override: | |||
file.managed: | |||
- name: /etc/systemd/system/{{ api.service }}.service.d/50-restarts.conf | |||
- source: salt://salt/files/systemd/{{ api.service }}.service_50-restarts | |||
- makedirs: True | |||
salt_api_systemd_reload: | |||
module.wait: | |||
- name: service.systemctl_reload | |||
- onchanges: | |||
- file: salt_api_systemd_override | |||
- watch_in: | |||
- service: salt_api_service | |||
{%- endif %} | |||
{%- endif %} |
@@ -0,0 +1,3 @@ | |||
[Service] | |||
Restart=always | |||
RestartSec=3 |
@@ -0,0 +1,3 @@ | |||
[Service] | |||
Restart=always | |||
RestartSec=3 |
@@ -0,0 +1,3 @@ | |||
[Service] | |||
Restart=always | |||
RestartSec=3 |
@@ -109,6 +109,22 @@ salt_master_service: | |||
splay: 5 | |||
{%- endif %} | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
salt_master_systemd_override: | |||
file.managed: | |||
- name: /etc/systemd/system/{{ master.service }}.service.d/50-restarts.conf | |||
- source: salt://salt/files/systemd/{{ master.service }}.service_50-restarts | |||
- makedirs: True | |||
salt_master_systemd_reload: | |||
module.wait: | |||
- name: service.systemctl_reload | |||
- onchanges: | |||
- file: salt_master_systemd_override | |||
- watch_in: | |||
- service: salt_master_service | |||
{%- endif %} | |||
/srv/salt/env: | |||
file.directory: | |||
- user: root |
@@ -64,6 +64,22 @@ salt_minion_service: | |||
- onlyif: /bin/false | |||
{%- endif %} | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
salt_minion_systemd_override: | |||
file.managed: | |||
- name: /etc/systemd/system/{{ minion.service }}.service.d/50-restarts.conf | |||
- source: salt://salt/files/systemd/{{ minion.service }}.service_50-restarts | |||
- makedirs: True | |||
salt_minion_systemd_reload: | |||
module.wait: | |||
- name: service.systemctl_reload | |||
- onchanges: | |||
- file: salt_minion_systemd_override | |||
- watch_in: | |||
- service: salt_minion_service | |||
{%- endif %} | |||
{#- Restart salt-minion if needed but after all states are executed #} | |||
salt_minion_service_restart: | |||
cmd.run: |
@@ -1,8 +1,7 @@ | |||
{%- from "salt/map.jinja" import minion,env_vars with context %} | |||
{%- if env_vars.engine is defined %} | |||
{%- if env_vars.engine == 'file' %} | |||
{%- if env_vars.engine == 'file' %} | |||
/etc/default/salt-minion: | |||
file.managed: | |||
- source: salt://salt/files/etc_default_salt-minion | |||
@@ -14,10 +13,11 @@ | |||
- onchanges_in: | |||
- cmd: salt_minion_service_restart | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
/etc/systemd/system/salt-minion.service.d/override.conf: | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
/etc/systemd/system/salt-minion.service.d/40-override: | |||
file.managed: | |||
- source: salt://salt/files/systemd_minion_override.conf | |||
- name: /etc/systemd/system/salt-minion.service.d/40-override | |||
- source: salt://salt/files/systemd/salt-minion.service_40-override | |||
- user: root | |||
- makedirs: True | |||
- group: root | |||
@@ -26,7 +26,6 @@ | |||
- {{ minion.install_state }} | |||
- onchanges_in: | |||
- cmd: salt_minion_service_restart | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} |
@@ -125,6 +125,23 @@ salt_minion_service: | |||
- onlyif: /bin/false | |||
{%- endif %} | |||
{%- if grains.get('init', None) == 'systemd' %} | |||
salt_minion_systemd_override: | |||
file.managed: | |||
- name: /etc/systemd/system/{{ minion.service }}.service.d/50-restarts.conf | |||
- source: salt://salt/files/systemd/{{ minion.service }}.service_50-restarts | |||
- makedirs: True | |||
salt_minion_systemd_reload: | |||
module.wait: | |||
- name: service.systemctl_reload | |||
- onchanges: | |||
- file: salt_minion_systemd_override | |||
- watch_in: | |||
- service: salt_minion_service | |||
{%- endif %} | |||
{#- Restart salt-minion if needed but after all states are executed #} | |||
salt_minion_service_restart: | |||
cmd.run: |