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>
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
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
#\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
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: >
# 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
#\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