Adjust file descriptor limit when systemd is used
Change-Id: I1039463e860e613f56fb2b813078d2c134f6b65d Related-Bug: #1623164
This commit is contained in:
parent
e533c25ce0
commit
716494ee86
@ -35,6 +35,18 @@
|
||||
- rabbitmq-config
|
||||
- rabbitmq-cluster
|
||||
|
||||
- name: Create rabbitmq systemd service config dir
|
||||
file:
|
||||
path: "/etc/systemd/system/rabbitmq-server.service.d"
|
||||
state: "directory"
|
||||
group: "root"
|
||||
owner: "root"
|
||||
mode: "0755"
|
||||
when:
|
||||
- pid1_name == "systemd"
|
||||
tags:
|
||||
- rabbitmq-config
|
||||
|
||||
- name: Create rabbitmq config
|
||||
register: rabbit_config_changed
|
||||
template:
|
||||
@ -47,6 +59,24 @@
|
||||
tags:
|
||||
- rabbitmq-config
|
||||
|
||||
- name: Apply resource limits (systemd)
|
||||
register: rabbit_resource_limit_changed
|
||||
template:
|
||||
src: "limits.conf.j2"
|
||||
dest: "/etc/systemd/system/rabbitmq-server.service.d/limits.conf"
|
||||
when:
|
||||
- pid1_name == "systemd"
|
||||
tags:
|
||||
- rabbitmq-config
|
||||
|
||||
- name: Reload the systemd daemon
|
||||
command: "systemctl daemon-reload"
|
||||
when:
|
||||
- pid1_name == "systemd"
|
||||
- rabbit_resource_limit_changed|changed
|
||||
tags:
|
||||
- rabbitmq-config
|
||||
|
||||
- include: rabbitmq_restart.yml
|
||||
when: rabbit_config_changed|changed or rabbitmq_plugin|changed or rabbitmq_queue_mirror|changed
|
||||
|
||||
|
4
templates/limits.conf.j2
Normal file
4
templates/limits.conf.j2
Normal file
@ -0,0 +1,4 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Service]
|
||||
LimitNOFILE={{ rabbitmq_ulimit }}
|
Loading…
Reference in New Issue
Block a user