Add rabbitmq-limits role

This patch adds the rabbitmq-limits role created from
validations/rabbitmq-limits.yaml.

Change-Id: If81d39e238e55d82ac19a6a9240df087e77e6825
Depends-on: I7541bfd244acaf1d00d18b3eef031dbadfe4dd4a
Implements: blueprint validation-framework
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud 2019-02-25 15:08:38 +01:00
parent 6ecfb48553
commit 5e9929adc8
5 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,12 @@
---
- hosts: Controller
vars:
metadata:
name: Rabbitmq limits
description: >
Make sure the rabbitmq file descriptor limits are set to reasonable values.
groups:
- post-deployment
min_fd_limit: 16384
roles:
- rabbitmq-limits

View File

@ -0,0 +1,2 @@
---
min_fd_limit: 16384

View File

@ -0,0 +1,28 @@
galaxy_info:
author: TripleO Validations Team
company: Red Hat
license: Apache
min_ansible_version: 2.4
platforms:
- name: CentOS
versions:
- 7
- name: RHEL
versions:
- 7
categories:
- cloud
- baremetal
- system
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []

View File

@ -0,0 +1,18 @@
---
- name: Set container_cli fact from the inventory
set_fact:
container_cli: "{{ hostvars[inventory_hostname].container_cli }}"
- name: Get file_descriptors total_limit
become: true
register: actual_fd_limit
shell: >
"{{ container_cli }}" exec $("{{ container_cli }}" ps -q --filter "name=rabbitmq" | head -1)
rabbitmqctl eval 'proplists:get_value(max_fds, erlang:system_info(check_io)).'
changed_when: false
- name: Verify the actual limit exceeds the minimal value
fail:
msg: >-
{{ actual_fd_limit.stdout }} must be greater than or equal to {{ min_fd_limit }}
failed_when: "actual_fd_limit.stdout|int < min_fd_limit"

View File

@ -0,0 +1,7 @@
---
metadata:
name: Rabbitmq limits
description: >
Make sure the rabbitmq file descriptor limits are set to reasonable values.
groups:
- post-deployment