]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Get OSD bootstrap key on the current node if possible 197/head
authorSergio de Carvalho <scarvalhojr@users.noreply.github.com>
Thu, 16 Apr 2015 16:35:46 +0000 (17:35 +0100)
committerSergio de Carvalho <scarvalhojr@users.noreply.github.com>
Tue, 28 Apr 2015 08:54:01 +0000 (09:54 +0100)
When deploying monitor and OSD daemons on the same node, it is
possible to retrieve the OSD bootstrap key from the node itself
(if the monitor recipe has already been applied), instead of
relying on a search in Chef for existing monitors.

This change also serves as a workaround when monitor and OSD
daemons are being installed on the first node of the cluster and,
for some reason, chef-client doesn't converge at the first attempt.
Without this change, running chef-client a second time, the node
might not be found with the Chef search.

libraries/default.rb

index 29b3ca6f04d26f0acb2a2d338a64ff17d476913a..44a47e1a13e136a10da0d2bbca0c1924f06cb281 100644 (file)
@@ -39,6 +39,8 @@ def osd_secret
   if node['ceph']['encrypted_data_bags']
     secret = Chef::EncryptedDataBagItem.load_secret(node['ceph']['osd']['secret_file'])
     return Chef::EncryptedDataBagItem.load('ceph', 'osd', secret)['secret']
+  elsif node['ceph']['bootstrap_osd_key']
+    return node['ceph']['bootstrap_osd_key']
   else
     return mon_nodes[0]['ceph']['bootstrap_osd_key']
   end