Add sysctl customization: swapiness

This commit is contained in:
Nemo 2020-07-12 13:41:56 +02:00
parent 7ceb1742b3
commit 2c9ff9fe57
6 changed files with 95 additions and 9 deletions

View file

@ -1,12 +1,13 @@
---
- hosts: all
roles:
- auto_reboot
- auto_upgrade
- client_ntp
- client_resolvers
- client_tools
- users_sudo
- client_iptables
- munin-node
- munin-async
# - auto_reboot
# - auto_upgrade
- sysctl_customizations
# - client_ntp
# - client_resolvers
# - client_tools
# - users_sudo
# - client_iptables
# - munin-node
# - munin-async

View file

@ -0,0 +1,42 @@
Ansible Role: systctl customization
=========
This role set up sysctl customization for a GNU/Linux server.
Requirements
------------
None.
Role Variables
--------------
All variables and default values are defined in `defaults/main.yml` :
# Sysctl swapiness value
sysctl_vm_swapiness: 10
# Sysctl config file
sysctl_config_file: /etc/sysctl.d/56-ansible.conf
Dependencies
------------
None.
Example Playbook
----------------
- hosts: all
roles:
- sysctl_customizations
License
-------
BSD
Author Information
------------------
This role was created in 2020 by Nemo.

View file

@ -0,0 +1,8 @@
---
# defaults file for sysctl_customization
# Sysctl swapiness value
sysctl_vm_swapiness: '10'
# Sysctl config file
sysctl_config_file: /etc/sysctl.d/56-ansible.conf

View file

@ -0,0 +1,26 @@
galaxy_info:
author: nemo
description: Set up sysctl customizations service for GNU/Linux.
company: Wirebrass
license: license (BSD)
min_ansible_version: 2.4
platforms:
- name: Debian
versions:
- stretch
- buster
- name: Gentoo
versions:
- all
galaxy_tags:
- sysctl
- swapiness
- system
- server
- auto
dependencies: []

View file

@ -0,0 +1,3 @@
---
# Main tasks file for sysctl_customizations
- import_tasks: sysctl.yml

View file

@ -0,0 +1,6 @@
---
- sysctl:
name: vm.swappiness
value: "{{ sysctl_vm_swapiness }}"
state: present
sysctl_file: "{{ sysctl_config_file }}"