diff --git a/roles/koschei/backend/tasks/main.yml b/roles/koschei/backend/tasks/main.yml index 27bc3e1878..3401eeefca 100644 --- a/roles/koschei/backend/tasks/main.yml +++ b/roles/koschei/backend/tasks/main.yml @@ -22,7 +22,7 @@ - config - service -- name: install systemd config files +- name: install systemd config files (memory) copy: > src=systemd-memory-limit.conf dest=/etc/systemd/system/{{ item }}.service.d/memory-limit.conf @@ -38,6 +38,18 @@ - config - service +- name: install systemd config files (restart) + template: > + src=systemd-restart.conf.j2 + dest=/etc/systemd/system/{{ item }}.service.d/restart.conf + with_items: "{{ koschei_backend_services }}" + notify: + - reload systemd + tags: + - koschei + - config + - service + - name: install config files template: > src="{{ item }}.j2" diff --git a/roles/koschei/backend/templates/systemd-restart-limit.conf.j2 b/roles/koschei/backend/templates/systemd-restart-limit.conf.j2 new file mode 100644 index 0000000000..9cf6fd950d --- /dev/null +++ b/roles/koschei/backend/templates/systemd-restart-limit.conf.j2 @@ -0,0 +1,6 @@ +[Service] +{% if env == 'staging' %} +RestartSec=600 +{% else %} +RestartSec=10 +{% endif %}