2015-01-07 18:41:35 +08:00
|
|
|
---
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: disable osd directory parsing by updatedb
|
2015-01-07 18:41:35 +08:00
|
|
|
command: updatedb -e /var/lib/ceph
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-01-07 18:41:35 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: disable transparent hugepage
|
2015-01-15 17:58:45 +08:00
|
|
|
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-06-26 06:26:03 +08:00
|
|
|
when: disable_transparent_hugepage
|
2015-01-15 18:42:51 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: disable swap
|
2015-01-15 18:42:51 +08:00
|
|
|
command: swapoff -a
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-06-26 06:26:03 +08:00
|
|
|
when: disable_swap
|
2015-01-13 18:09:53 +08:00
|
|
|
|
2016-02-16 22:40:49 +08:00
|
|
|
- name: get default vm.min_free_kbytes
|
|
|
|
command: sysctl -b vm.min_free_kbytes
|
2016-02-29 22:57:40 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-02-16 22:40:49 +08:00
|
|
|
register: default_vm_min_free_kbytes
|
|
|
|
|
2016-02-16 22:48:28 +08:00
|
|
|
- name: define vm.min_free_kbytes
|
2016-02-15 22:03:10 +08:00
|
|
|
set_fact:
|
2016-02-16 22:48:28 +08:00
|
|
|
vm_min_free_kbytes: "{{ 4194303 if ansible_memtotal_mb >= 49152 else default_vm_min_free_kbytes.stdout }}"
|
2016-02-15 22:03:10 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: apply operating system tuning
|
2015-09-04 00:18:53 +08:00
|
|
|
sysctl:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
state: present
|
|
|
|
sysctl_file: /etc/sysctl.conf
|
|
|
|
ignoreerrors: yes
|
2015-01-13 17:31:26 +08:00
|
|
|
with_items: os_tuning_params
|