]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Make OS tuning var configurable and file re-ordering 176/head
authorSébastien Han <sebastien.han@enovance.com>
Wed, 7 Jan 2015 10:41:35 +0000 (11:41 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Wed, 7 Jan 2015 10:44:40 +0000 (11:44 +0100)
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>
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/main.yml
roles/ceph-common/tasks/os_check.yml [new file with mode: 0644]
roles/ceph-common/tasks/os_tuning.yml [new file with mode: 0644]
roles/ceph-common/tasks/prerequisite_ice.yml [new file with mode: 0644]

index 9f72b44d2d97a39f1e67712d5f42d8e2527977b8..180b5c5e3fcec3e51ba5f40e4c4cf38ef2e72b39 100644 (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.\r
 ceph_dev_redhat_distro: centos7\r
 \r
-###############\r
-# CONFIGURATION\r
-###############\r
+\r
+####################\r
+# CEPH CONFIGURATION\r
+####################\r
 \r
 ## Ceph options\r
 #\r
@@ -112,3 +113,11 @@ radosgw: false # referenced in monitor role too.
 # enable this mode _only_ when you have a single node\r
 # if you don't want it keep the option commented\r
 #common_single_host_mode: true\r
+\r
+\r
+###########\r
+# OS TUNING\r
+###########\r
+\r
+os_tuning_pid_max: 4194303\r
+os_tuning_file_max: 26234859\r
index 400d6fd986e762931bd25f7d0496c0f68c7279e7..debd7aa4ce6130a0774616d33cb5464438f82281 100644 (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'
 
diff --git a/roles/ceph-common/tasks/os_check.yml b/roles/ceph-common/tasks/os_check.yml
new file mode 100644 (file)
index 0000000..3b716ef
--- /dev/null
@@ -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']"
diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/os_tuning.yml
new file mode 100644 (file)
index 0000000..31581db
--- /dev/null
@@ -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
diff --git a/roles/ceph-common/tasks/prerequisite_ice.yml b/roles/ceph-common/tasks/prerequisite_ice.yml
new file mode 100644 (file)
index 0000000..6806650
--- /dev/null
@@ -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