From 4c05a1622343f47f5d7305ff5c58d84c04ed80da Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Tue, 30 May 2017 15:37:15 +0200 Subject: [PATCH] Fix single-monitor deployment Commit ce4fe7a084a727390e83bb7da5adb697fe2f7405 introduced auto-generation of 'monitor-secret' and 'fsid'. However, the auto-generated 'monitor-secret' is not used when doing single-monitor deployments. This commit fixes that. Change-Id: Iae41b3296c2dfd86823cac91f70d582951206261 Closes-Bug: #1694435 --- hooks/ceph_hooks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 29bc567b..c25138bb 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -220,9 +220,10 @@ def config_changed(): emit_cephconf() # Support use of single node ceph - if not ceph.is_bootstrapped() and int(config('monitor-count')) == 1: + if (not ceph.is_bootstrapped() and int(config('monitor-count')) == 1 and + is_leader()): status_set('maintenance', 'Bootstrapping single Ceph MON') - ceph.bootstrap_monitor_cluster(config('monitor-secret')) + ceph.bootstrap_monitor_cluster(leader_get('monitor-secret')) ceph.wait_for_bootstrap()