redis: variable to disable transparent hugepage (default: do nothing)
gitea/ansible-roles/pipeline/head This commit looks good Details

peertube
Jérémy Lecour 4 months ago committed by Jérémy Lecour
parent fc52fbf4bc
commit 554c086b79

@ -25,6 +25,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
* lxc-solr: set homedir and port at install
* minifirewall: whitelist deb.freexian.com
* redis: some values should be quoted
* redis: variable to disable transparent hugepage (default: do nothing)
* squid: whitelist deb.freexian.com
### Fixed

@ -61,5 +61,9 @@ redis_sentinel_install: False
redis_default_server_disabled: False
# Set to Null to leave as is
# Set to "always", "madvise" or "never" for custom value
redis_sysctl_transparent_hugepage_enabled: Null
general_alert_email: "root@localhost"
log2mail_alert_email: Null

@ -23,3 +23,8 @@
service:
name: log2mail
state: restarted
- name: restart sysfsutils
service:
name: sysfsutils
state: restarted

@ -3,7 +3,19 @@
- set_fact:
redis_restart_handler_name: "{{ redis_restart_if_needed | bool | ternary('restart redis', 'restart redis (noop)') }}"
- name: Redis is installed.
- name: Linux kernel overcommit memory setting is enabled
sysctl:
name: "vm.overcommit_memory"
value: "1"
sysctl_file: "/etc/sysctl.d/evolinux-redis.conf"
state: present
reload: yes
- name: Customize Kernel Transparent Huge Page
include: thp.yml
when: redis_sysctl_transparent_hugepage_enabled is not none
- name: Redis is installed
apt:
name:
- redis-server
@ -13,7 +25,7 @@
- redis
- packages
- name: Redis Sentinel is installed.
- name: Redis Sentinel is installed
apt:
name: "redis-sentinel"
state: present
@ -22,14 +34,6 @@
- packages
when: redis_sentinel_install | bool
- name: Linux kernel overcommit memory setting is enabled
sysctl:
name: "vm.overcommit_memory"
value: "1"
sysctl_file: "/etc/sysctl.d/evolinux-redis.conf"
state: present
reload: yes
- name: Get Redis version
shell: "redis-server -v | grep -Eo '(v=\\S+)' | cut -d'=' -f 2 | grep -E '^([0-9]|\\.)+$'"
changed_when: false

@ -0,0 +1,34 @@
---
- name: sysfsutils is installed
apt:
name:
- sysfsutils
state: present
tags:
- redis
- packages
- kernel
- name: Check possible values for THP
assert:
that: redis_sysctl_transparent_hugepage_enabled is in ['always', 'madvise', 'never']
msg: "redis_sysctl_transparent_hugepage_enabled has incorrect value : '{{ redis_sysctl_transparent_hugepage_enabled }}' not in ['always', 'madvise', 'never']"
tags:
- redis
- kernel
- name: "Set THP to {{ redis_sysctl_transparent_hugepage_enabled }} at boot"
lineinfile:
path: /etc/sysfs.conf
line: kernel/mm/transparent_hugepage/enabled = {{ redis_sysctl_transparent_hugepage_enabled }}
regexp: "kernel/mm/transparent_hugepage/enabled"
tags:
- redis
- kernel
- name: "Set THP to {{ redis_sysctl_transparent_hugepage_enabled }} for this boot"
shell: "echo '{{ redis_sysctl_transparent_hugepage_enabled }}' >> /sys/kernel/mm/transparent_hugepage/enabled"
tags:
- redis
- kernel
Loading…
Cancel
Save