Make OS tuning var configurable and file re-ordering

Depending on the OS you are runnning on you should be able to configure
these values.
Re-ordering file for clarity as well.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
pull/176/head
Sébastien Han 2015-01-07 11:41:35 +01:00
parent ea34a21e53
commit 81b44fcfe2
5 changed files with 87 additions and 71 deletions

View File

@ -42,9 +42,10 @@ ceph_dev_branch: master # development branch you would like to use e.g: master,
# For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important.
ceph_dev_redhat_distro: centos7
###############
# CONFIGURATION
###############
####################
# CEPH CONFIGURATION
####################
## Ceph options
#
@ -112,3 +113,11 @@ radosgw: false # referenced in monitor role too.
# enable this mode _only_ when you have a single node
# if you don't want it keep the option commented
#common_single_host_mode: true
###########
# OS TUNING
###########
os_tuning_pid_max: 4194303
os_tuning_file_max: 26234859

View File

@ -1,76 +1,11 @@
---
- name: Fail on unsupported system
fail: "msg=System not supported {{ ansible_system }}"
when: "ansible_system not in ['Linux']"
- include: os_check.yml
- name: Fail on unsupported architecture
fail: "msg=Architecture not supported {{ ansible_architecture }}"
when: "ansible_architecture not in ['x86_64']"
- include: os_tuning.yml
- name: Fail on unsupported distribution
fail: "msg=Distribution not supported {{ ansible_os_family }}"
when: "ansible_os_family not in ['Debian', 'RedHat']"
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph
ignore_errors: true
- name: Increase PID max value to a very large value
sysctl: >
name="kernel.pid_max"
value=4194303
state=present
sysctl_file=/etc/sysctl.conf
- name: Increase the maximum number of open files
sysctl: >
name="fs.file-max"
value=13211539
state=present
sysctl_file=/etc/sysctl.conf
- name: Create package directory
file: >
path={{ ceph_stable_ice_temp_path }}
state=directory
owner=root
group=root
mode=0644
- include: prerequisite_ice.yml
when: ceph_stable_ice
- name: Get ICE packages
get_url: >
url_username={{ ceph_stable_ice_user }}
url_password={{ ceph_stable_ice_password }}
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
when: ceph_stable_ice
- name: Get ICE Kernel Modules
get_url: >
url_username={{ ceph_stable_ice_user }}
url_password={{ ceph_stable_ice_password }}
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }}
dest={{ ceph_stable_ice_temp_path }}
with_items:
- kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm
- kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm
when: ceph_stable_ice and ansible_os_family == 'RedHat'
- name: Stat extracted repo files
stat: >
path={{ ceph_stable_ice_temp_path }}/ice_setup.py
register: repo_exist
when: ceph_stable_ice
- name: Extract packages
shell: "cd {{ ceph_stable_ice_temp_path }} && tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz"
when: ceph_stable_ice and repo_exist.stat.exists == False
- name: Move the extracted packages
shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}"
when: ceph_stable_ice and repo_exist.stat.exists == False
- include: install_on_redhat.yml
when: ansible_os_family == 'RedHat'

View File

@ -0,0 +1,12 @@
---
- name: Fail on unsupported system
fail: "msg=System not supported {{ ansible_system }}"
when: "ansible_system not in ['Linux']"
- name: Fail on unsupported architecture
fail: "msg=Architecture not supported {{ ansible_architecture }}"
when: "ansible_architecture not in ['x86_64']"
- name: Fail on unsupported distribution
fail: "msg=Distribution not supported {{ ansible_os_family }}"
when: "ansible_os_family not in ['Debian', 'RedHat']"

View File

@ -0,0 +1,18 @@
---
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph
ignore_errors: true
- name: Increase PID max value to a very large value
sysctl: >
name="kernel.pid_max"
value={{ os_tuning_pid_max }}
state=present
sysctl_file=/etc/sysctl.conf
- name: Increase the maximum number of open files
sysctl: >
name="fs.file-max"
value={{ os_tuning_file_max }}
state=present
sysctl_file=/etc/sysctl.conf

View File

@ -0,0 +1,42 @@
---
- name: Create ICE package directory
file: >
path={{ ceph_stable_ice_temp_path }}
state=directory
owner=root
group=root
mode=0644
when: ceph_stable_ice
- name: Get ICE packages
get_url: >
url_username={{ ceph_stable_ice_user }}
url_password={{ ceph_stable_ice_password }}
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
when: ceph_stable_ice
- name: Get ICE Kernel Modules
get_url: >
url_username={{ ceph_stable_ice_user }}
url_password={{ ceph_stable_ice_password }}
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }}
dest={{ ceph_stable_ice_temp_path }}
with_items:
- kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm
- kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm
when: ceph_stable_ice and ansible_os_family == 'RedHat'
- name: Stat extracted ICE repo files
stat: >
path={{ ceph_stable_ice_temp_path }}/ice_setup.py
register: repo_exist
when: ceph_stable_ice
- name: Extract ICE packages
shell: "cd {{ ceph_stable_ice_temp_path }} && tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz"
when: ceph_stable_ice and repo_exist.stat.exists == False
- name: Move ICE extracted packages
shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}"
when: ceph_stable_ice and repo_exist.stat.exists == False