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
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2018-03-02 00:33:33 +08:00
|
|
|
- ansible_os_family == "Debian"
|
2017-09-15 06:48:53 +08:00
|
|
|
- osd_objectstore == 'filestore'
|
2018-03-06 01:57:29 +08:00
|
|
|
- ansible_os_family == "Debian"
|
2015-01-07 18:41:35 +08:00
|
|
|
|
2018-02-20 02:13:21 +08:00
|
|
|
- name: disable osd directory path in updatedb.conf
|
|
|
|
replace:
|
|
|
|
dest: /etc/updatedb.conf
|
|
|
|
regexp: '^(PRUNEPATHS(?!.*/var/lib/ceph).*)"$'
|
|
|
|
replace: '\1 /var/lib/ceph"'
|
|
|
|
failed_when: false
|
|
|
|
when:
|
2018-03-02 00:33:33 +08:00
|
|
|
- ansible_os_family == "Debian"
|
2018-02-20 02:13:21 +08:00
|
|
|
- osd_objectstore == 'filestore'
|
2018-03-06 01:57:29 +08:00
|
|
|
- ansible_os_family == "Debian"
|
2018-02-20 02:13:21 +08:00
|
|
|
|
2017-04-08 14:06:18 +08:00
|
|
|
- name: create tmpfiles.d directory
|
|
|
|
file:
|
|
|
|
path: "/etc/tmpfiles.d"
|
|
|
|
state: "directory"
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0755"
|
|
|
|
register: "tmpfiles_d"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- disable_transparent_hugepage
|
2017-04-08 14:06:18 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: disable transparent hugepage
|
2017-04-08 14:06:18 +08:00
|
|
|
template:
|
|
|
|
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"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- disable_transparent_hugepage
|
2015-01-15 18:42:51 +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
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-02-16 22:40:49 +08:00
|
|
|
register: default_vm_min_free_kbytes
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact 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
|
2017-03-25 03:52:37 +08:00
|
|
|
sysctl_file: /etc/sysctl.d/ceph-tuning.conf
|
2018-03-15 06:41:53 +08:00
|
|
|
sysctl_set: yes
|
2015-09-04 00:18:53 +08:00
|
|
|
ignoreerrors: yes
|
2016-11-03 17:16:33 +08:00
|
|
|
with_items: "{{ os_tuning_params }}"
|
2018-03-15 06:46:23 +08:00
|
|
|
|
|
|
|
- name: increase aio-max-nr for bluestore
|
|
|
|
sysctl:
|
|
|
|
name: fs.aio-max-nr
|
|
|
|
value: 1048576
|
|
|
|
sysctl_file: /etc/sysctl.d/ceph-tuning.conf
|
|
|
|
sysctl_set: yes
|
|
|
|
when:
|
|
|
|
- osd_objectstore == 'bluestore'
|