2015-01-07 18:41:35 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create tmpfiles.d directory
|
|
|
|
ansible.builtin.file:
|
2017-04-08 14:06:18 +08:00
|
|
|
path: "/etc/tmpfiles.d"
|
|
|
|
state: "directory"
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0755"
|
|
|
|
register: "tmpfiles_d"
|
2019-05-22 16:02:42 +08:00
|
|
|
when: disable_transparent_hugepage | bool
|
2017-04-08 14:06:18 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable transparent hugepage
|
|
|
|
ansible.builtin.template:
|
2017-04-08 14:06:18 +08:00
|
|
|
src: "tmpfiles_hugepage.j2"
|
|
|
|
dest: "/etc/tmpfiles.d/ceph_transparent_hugepage.conf"
|
|
|
|
group: "root"
|
|
|
|
owner: "root"
|
|
|
|
mode: "0644"
|
|
|
|
force: "yes"
|
|
|
|
validate: "systemd-tmpfiles --create %s"
|
2019-05-22 16:02:42 +08:00
|
|
|
when: disable_transparent_hugepage | bool
|
2015-01-15 18:42:51 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Get default vm.min_free_kbytes
|
|
|
|
ansible.builtin.slurp:
|
2021-01-09 06:31:03 +08:00
|
|
|
src: /proc/sys/vm/min_free_kbytes
|
2016-02-16 22:40:49 +08:00
|
|
|
register: default_vm_min_free_kbytes
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set_fact vm_min_free_kbytes
|
|
|
|
ansible.builtin.set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
vm_min_free_kbytes: "{{ 4194303 if ansible_facts['memtotal_mb'] >= 49152 else default_vm_min_free_kbytes.content | b64decode | trim }}"
|
2016-02-15 22:03:10 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Apply operating system tuning
|
|
|
|
ansible.posix.sysctl:
|
2015-09-04 00:18:53 +08:00
|
|
|
name: "{{ item.name }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
state: present
|
2017-03-25 03:52:37 +08:00
|
|
|
sysctl_file: /etc/sysctl.d/ceph-tuning.conf
|
2024-02-14 18:14:02 +08:00
|
|
|
sysctl_set: true
|
|
|
|
ignoreerrors: true
|
2018-05-10 18:15:30 +08:00
|
|
|
with_items:
|
2019-11-06 23:15:53 +08:00
|
|
|
- { name: "fs.aio-max-nr", value: "1048576", enable: "{{ osd_objectstore == 'bluestore' }}" }
|
2018-05-10 18:15:30 +08:00
|
|
|
- "{{ os_tuning_params }}"
|
2019-05-22 16:02:42 +08:00
|
|
|
when: item.enable | default(true) | bool
|