Merge "Add controller-ulimits role"

This commit is contained in:
Zuul 2019-04-02 20:59:58 +00:00 committed by Gerrit Code Review
commit 38c74eb90b
5 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,13 @@
---
- hosts: Controller
vars:
metadata:
name: Check controller ulimits
description: >
This will check the ulimits of each controller.
groups:
- post-deployment
nofiles_min: 1024
nproc_min: 2048
roles:
- controller-ulimits

View File

@ -0,0 +1,3 @@
---
nofiles_min: 1024
nproc_min: 2048

View File

@ -0,0 +1,27 @@
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,28 @@
---
- name: Get nofiles limit
become: true
# NOTE: `ulimit` is a shell builtin so we have to invoke it like this:
command: sh -c "ulimit -n"
register: nofilesval
changed_when: False
- name: Check nofiles limit
fail:
msg: >
nofiles is set to {{ nofilesval.stdout }}. It should be at least
{{ nofiles_min }} or higher, depending on available resources.
failed_when: "nofilesval.stdout|int < nofiles_min"
- name: Get nproc limit
become: true
# NOTE: `ulimit` is a shell builtin so we have to invoke it like this:
command: sh -c "ulimit -u"
register: nprocval
changed_when: False
- name: Check nproc limit
fail:
msg: >
nproc is set to {{ nprocval.stdout }}. It should be at least
{{ nproc_min }} or higher, depending on available resources.
failed_when: "nprocval.stdout|int < nproc_min"

View File

@ -0,0 +1,7 @@
---
metadata:
name: Check controller ulimits
description: >
This will check the ulimits of each controller.
groups:
- post-deployment