Add option to skip generating fsid

If using another method to generate a consistent fsid, then we can
skip creation of an (unused) cluster UUID file. If cephx is disabled
as well, we can skip creation of the fetch directory entirely.
pull/569/head
Chris St. Pierre 2016-02-25 10:29:12 -06:00
parent e9f3e792b0
commit 8e0d53e5a4
3 changed files with 21 additions and 0 deletions

View File

@ -144,7 +144,15 @@ dummy:
## Ceph options
#
# Each cluster requires a unique, consistent filesystem ID. By
# default, the playbook generates one for you and stores it in a file
# in `fetch_directory`. If you want to customize how the fsid is
# generated, you may find it useful to disable fsid generation to
# avoid cluttering up your ansible repo. If you set `generate_fsid` to
# false, you *must* generate `fsid` in another way.
#fsid: "{{ cluster_uuid.stdout }}"
#generate_fsid: true
#cephx: true
#cephx_require_signatures: true # Kernel RBD does NOT support signatures!
#cephx_cluster_require_signatures: true

View File

@ -146,7 +146,15 @@ ceph_dev_redhat_distro: centos7
## Ceph options
#
# Each cluster requires a unique, consistent filesystem ID. By
# default, the playbook generates one for you and stores it in a file
# in `fetch_directory`. If you want to customize how the fsid is
# generated, you may find it useful to disable fsid generation to
# avoid cluttering up your ansible repo. If you set `generate_fsid` to
# false, you *must* generate `fsid` in another way.
fsid: "{{ cluster_uuid.stdout }}"
generate_fsid: true
cephx: true
cephx_require_signatures: true # Kernel RBD does NOT support signatures for Kernels < 3.18!
cephx_cluster_require_signatures: true

View File

@ -124,12 +124,16 @@
changed_when: false
become: false
run_once: true
when:
cephx or
generate_fsid
- name: generate cluster uuid
local_action: shell python -c 'import uuid; print str(uuid.uuid4())' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
creates="{{ fetch_directory }}/ceph_cluster_uuid.conf"
register: cluster_uuid
become: false
when: generate_fsid
- name: read cluster uuid if it already exists
local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf
@ -137,6 +141,7 @@
changed_when: false
register: cluster_uuid
become: false
when: generate_fsid
- name: create ceph conf directory
file: