Adjust file descriptor limit when systemd is used

Change-Id: I1039463e860e613f56fb2b813078d2c134f6b65d
Related-Bug: #1623164
This commit is contained in:
Paulo Matias 2016-09-13 19:14:28 -03:00
parent e533c25ce0
commit 716494ee86
2 changed files with 34 additions and 0 deletions

View File

@ -35,6 +35,18 @@
- rabbitmq-config - rabbitmq-config
- rabbitmq-cluster - 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 - name: Create rabbitmq config
register: rabbit_config_changed register: rabbit_config_changed
template: template:
@ -47,6 +59,24 @@
tags: tags:
- rabbitmq-config - 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 - include: rabbitmq_restart.yml
when: rabbit_config_changed|changed or rabbitmq_plugin|changed or rabbitmq_queue_mirror|changed when: rabbit_config_changed|changed or rabbitmq_plugin|changed or rabbitmq_queue_mirror|changed

4
templates/limits.conf.j2 Normal file
View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
[Service]
LimitNOFILE={{ rabbitmq_ulimit }}