From: Sergio de Carvalho Date: Thu, 16 Apr 2015 16:35:46 +0000 (+0100) Subject: Get OSD bootstrap key on the current node if possible X-Git-Tag: v0.8.1~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6472756eb52fcbfe2c1d7ea8a7bc45c9abc786ae;p=ceph-cookbooks.git Get OSD bootstrap key on the current node if possible 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. --- diff --git a/libraries/default.rb b/libraries/default.rb index 29b3ca6..44a47e1 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -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