robertdebock.ulimit
Ansible Role Ulimit
This guide explains how to set up ulimit on your system.
| GitHub | GitLab | Downloads | Version |
|---|---|---|---|
Example Playbook
Here is a simple example that comes from molecule/default/converge.yml. It is tested whenever you make changes to the project.
---
- name: Converge
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.ulimit
ulimit_items:
- limit_item: nofile
domain: root
limit_type: soft
value: 1048576
- limit_item: nproc
domain: root
limit_type: soft
value: 1024
- limit_item: nproc
domain: root
limit_type: hard
value: 2048
Before running this, ensure that your machine is set up. In Continuous Integration (CI), this can be done using molecule/default/prepare.yml:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
For more details and examples, check out this explanation on using these roles.
Role Variables
Default values for variables can be found in defaults/main.yml:
---
# defaults for ulimit
# Default domain, can be changed per item.
ulimit_domain: '*'
# Default limit type, can also be changed.
ulimit_limit_type: soft
# Destination file to write to.
ulimit_dest: /etc/security/limits.conf
# Create a backup of limits.conf if changes are made?
ulimit_backup: true
Requirements
- Python packages listed in requirements.txt.
State of Used Roles
The following roles help prepare your system, but you can use other methods too.
| Requirement | GitHub | GitLab |
|---|---|---|
| robertdebock.bootstrap |
Context
This role works with many other compatible roles. For more information, check the documentation of these roles.
Here’s a graphic showing related roles:

Compatibility
This role has been tested with the following container images:
| Container | Tags |
|---|---|
| Amazon | Candidate |
| EL | 9 |
| Debian | All |
| Fedora | All |
| Ubuntu | All |
Minimum Ansible version needed is 2.12. Tests have been conducted on:
- Previous versions
- Current versions
- Development versions
If you encounter any issues, please report them on GitHub.
License
Author Information
Please consider sponsoring me.
ansible-galaxy install robertdebock.ulimit