badges: fedmsg-hub: try to add systemd environment variables to limit 2 am work

This commit is contained in:
Stephen Smoogen 2019-02-20 19:36:12 +00:00
parent 03259b09e5
commit 1bb6a4663e
4 changed files with 63 additions and 0 deletions

View file

@ -0,0 +1,2 @@
[Service]
MemoryLimit=8G

View file

@ -14,6 +14,61 @@
- badges
- badges/backend
- name: create systemd config directories
file: >
path="/etc/systemd/system/{{ item }}.service.d"
state=directory
with_items:
- fedmsg-hub
notify:
- reload systemd
tags:
- badges/backend
- config
- service
- name: install systemd config files (memory)
copy: >
src=systemd/systemd-memory-limit.conf
dest=/etc/systemd/system/{{ item }}.service.d/memory-limit.conf
with_items:
- fedmsg-hub
notify:
- reload systemd
- restart fedmsg-hub
tags:
- badges/backend
- config
- service
- name: install systemd config files (restart)
template: >
src=systemd-restart-limit.conf.j2
dest=/etc/systemd/system/{{ item }}.service.d/restart.conf
with_items:
- fedmsg-hub
notify:
- reload systemd
tags:
- badges/backend
- config
- service
- name: install systemd config files (environment)
template: >
src=systemd-environment.conf.j2
dest=/etc/systemd/system/{{ item }}.service.d/environment.conf
with_items:
- fedmsg-hub
notify:
- reload systemd
- restart fedmsg-hub
tags:
- badges/backend
- config
- service
- name: copy database configuration
template: >
src={{ item }} dest="/etc/fedmsg.d/{{ item }}"

View file

@ -0,0 +1,6 @@
[Service]
{% if env == 'staging' %}
RestartSec=600
{% else %}
RestartSec=10
{% endif %}