]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Add bootstrap-osd key after it's been created if databags are not used 206/head
authorNick Van Wiggeren <nvanwiggeren@digitalocean.com>
Wed, 5 Aug 2015 17:20:39 +0000 (13:20 -0400)
committerNick Van Wiggeren <nvanwiggeren@digitalocean.com>
Wed, 5 Aug 2015 17:26:20 +0000 (13:26 -0400)
This change fixes a regression introduced 807f08 that caused
the cookbook to fail if data_bags were not used. The bootstrap-osd
key would not be created at the time of the key being added to the
keyring, causing the chef run to fail. We now try to add the key after
we've checked if the key needs to be created, which will only happen
if we're not using data_bags

recipes/mon.rb

index aa70924941079defa19676982f97ce77cb10abb9..15f2fba68a29b40265d03c277cb81d279a86bd9b 100644 (file)
@@ -55,11 +55,6 @@ execute 'generate mon-secret as keyring' do
   notifies :create, 'ruby_block[save mon_secret]', :immediately
 end
 
-execute 'add bootstrap-osd key to keyring' do
-  command lazy { "ceph-authtool '#{keyring}' --name=client.bootstrap-osd --add-key='#{osd_secret}' --cap mon 'allow profile bootstrap-osd'  --cap osd 'allow profile bootstrap-osd'" }
-  only_if { osd_secret }
-end
-
 ruby_block 'save mon_secret' do
   block do
     fetch = Mixlib::ShellOut.new("ceph-authtool '#{keyring}' --print-key --name=mon.")
@@ -131,6 +126,11 @@ if use_cephx? && !node['ceph']['encrypted_data_bags']
   end
 end
 
+execute 'add bootstrap-osd key to keyring' do
+  command lazy { "ceph-authtool '#{keyring}' --name=client.bootstrap-osd --add-key='#{osd_secret}' --cap mon 'allow profile bootstrap-osd'  --cap osd 'allow profile bootstrap-osd'" }
+  only_if { osd_secret }
+end
+
 if node['ceph']['user_pools']
   # Create user-defined pools
   node['ceph']['user_pools'].each do |pool|