* 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)pull/78/merge
- creates: /etc/ssl/certs/{{ api.ssl.get('name', grains.id) }}-chain.crt | - creates: /etc/ssl/certs/{{ api.ssl.get('name', grains.id) }}-chain.crt | ||||
- watch_in: | - watch_in: | ||||
- service: salt_api_service | - service: salt_api_service | ||||
{%- endif %} | {%- endif %} | ||||
salt_api_service: | salt_api_service: | ||||
service.running: | service.running: | ||||
- name: salt-api | |||||
- name: {{ api.service }} | |||||
- require: | - require: | ||||
- pkg: salt_api_packages | - pkg: salt_api_packages | ||||
- watch: | - watch: | ||||
- file: /etc/salt/master.d/_api.conf | - 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 %} |
[Service] | |||||
Restart=always | |||||
RestartSec=3 |
[Service] | |||||
Restart=always | |||||
RestartSec=3 |
[Service] | |||||
Restart=always | |||||
RestartSec=3 |
splay: 5 | splay: 5 | ||||
{%- endif %} | {%- 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: | /srv/salt/env: | ||||
file.directory: | file.directory: | ||||
- user: root | - user: root |
- onlyif: /bin/false | - onlyif: /bin/false | ||||
{%- endif %} | {%- 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 #} | {#- Restart salt-minion if needed but after all states are executed #} | ||||
salt_minion_service_restart: | salt_minion_service_restart: | ||||
cmd.run: | cmd.run: |
{%- from "salt/map.jinja" import minion,env_vars with context %} | {%- from "salt/map.jinja" import minion,env_vars with context %} | ||||
{%- if env_vars.engine is defined %} | {%- if env_vars.engine is defined %} | ||||
{%- if env_vars.engine == 'file' %} | |||||
{%- if env_vars.engine == 'file' %} | |||||
/etc/default/salt-minion: | /etc/default/salt-minion: | ||||
file.managed: | file.managed: | ||||
- source: salt://salt/files/etc_default_salt-minion | - source: salt://salt/files/etc_default_salt-minion | ||||
- onchanges_in: | - onchanges_in: | ||||
- cmd: salt_minion_service_restart | - 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: | 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 | - user: root | ||||
- makedirs: True | - makedirs: True | ||||
- group: root | - group: root | ||||
- {{ minion.install_state }} | - {{ minion.install_state }} | ||||
- onchanges_in: | - onchanges_in: | ||||
- cmd: salt_minion_service_restart | - cmd: salt_minion_service_restart | ||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- endif %} | {%- endif %} |
- onlyif: /bin/false | - onlyif: /bin/false | ||||
{%- endif %} | {%- 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 #} | {#- Restart salt-minion if needed but after all states are executed #} | ||||
salt_minion_service_restart: | salt_minion_service_restart: | ||||
cmd.run: | cmd.run: |