]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Auto generate an FSID 147/head
authorSébastien Han <sebastien.han@enovance.com>
Thu, 13 Nov 2014 13:08:27 +0000 (14:08 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Thu, 13 Nov 2014 13:08:27 +0000 (14:08 +0100)
It has becomes really anoying to manually generate an fsid prior to the
inital bootstrap. This commit introduces a method that auto-generates an
fsid. If for whatever reasons you want to force your own fsid you can
simply edit these 3 files and override the fsid variable:

- roles/ceph-common/vars/main.yml
- roles/ceph-mon/vars/main.yml
- roles/ceph-osd/vars/main.yml

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
roles/ceph-common/tasks/main.yml
roles/ceph-common/vars/main.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/vars/main.yml
roles/ceph-osd/vars/main.yml

index c358fe75ebdb089dd693c36b24eb52df72380daf..3567dc30a5dc080efe1f707bbfca82147fa776e2 100644 (file)
   ignore_errors: true
   register: socket
 
+- name: Generate cluster UUID
+  shell: "uuidgen | tee /etc/ceph/ceph_cluster_uuid.conf" creates=/etc/ceph/ceph_cluster_uuid.conf
+  register: cluster_uuid
+
+- name: Read cluster UUID if it already exists
+  command: cat /etc/ceph/ceph_cluster_uuid.conf removes=/etc/ceph/ceph_cluster_uuid.conf
+  register: cluster_uuid
+
 - name: Generate Ceph configuration file
   template: >
     src=ceph.conf.j2
@@ -38,4 +46,8 @@
   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
+  sysctl: >
+    name="kernel.pid_max"
+    value=4194303
+    state=present
+    sysctl_file=/etc/sysctl.conf
index 79382fc80054cd9f30ae59fc406d5d512b0a7927..c4b090f3eb63683fa429814a9f4db820522cc6ff 100644 (file)
@@ -5,7 +5,7 @@
 #\r
 \r
 # ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT\r
-#fsid:\r
+fsid: "{{ cluster_uuid.stdout }}"\r
 \r
 ## Packages branch\r
 ceph_stable: true # use ceph stable branch\r
index 54ea3ba1523de59824a53c8bd7dcdd032fa86183..18edf5374ee2c3334a9ee00c63a3eb8281d056b9 100644 (file)
@@ -18,7 +18,7 @@
     mode=0644
 
 - name: Ceph monitor mkfs
-  command: "ceph-mon --mkfs -i {{ ansible_hostname }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring"
+  command: "ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ cluster_uuid.stdout }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring"
 
 - name: Start and add that the monitor service to the init sequence
   service: >
index 0aed6ee70900f8215aedeb4051f0cead9be73758..24111c09b708c1554dfb6d6211c019b43a328765 100644 (file)
@@ -2,7 +2,7 @@
 # You can override vars by using host or group vars\r
 \r
 # ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT\r
-# fsid:\r
+fsid: "{{ cluster_uuid.stdout }}"\r
 # monitor_secret:\r
 cephx: true\r
 \r
index bd81387d7a115feda97404d9b5da3f2283306bbf..fcda64e2e8f9841e61671536c4907599a3a66f6f 100644 (file)
@@ -6,7 +6,7 @@
 #\r
 \r
 # ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT\r
-# fsid:\r
+fsid: "{{ cluster_uuid.stdout }}"\r
 cephx: true\r
 \r
 # Devices to be used as OSDs\r