badges: fedmsg-hub: try to add systemd environment variables to limit 2 am work
This commit is contained in:
parent
03259b09e5
commit
1bb6a4663e
4 changed files with 63 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
[Service]
|
||||||
|
MemoryLimit=8G
|
|
@ -14,6 +14,61 @@
|
||||||
- badges
|
- badges
|
||||||
- badges/backend
|
- 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
|
- name: copy database configuration
|
||||||
template: >
|
template: >
|
||||||
src={{ item }} dest="/etc/fedmsg.d/{{ item }}"
|
src={{ item }} dest="/etc/fedmsg.d/{{ item }}"
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
[Service]
|
||||||
|
{% if env == 'staging' %}
|
||||||
|
RestartSec=600
|
||||||
|
{% else %}
|
||||||
|
RestartSec=10
|
||||||
|
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue