]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Passthrough arbitrary (global) config variables to ceph.conf.
authorTommi Virtanen <tv@inktank.com>
Fri, 8 Jun 2012 22:40:22 +0000 (15:40 -0700)
committerTommi Virtanen <tv@inktank.com>
Fri, 8 Jun 2012 22:40:22 +0000 (15:40 -0700)
Still sanity checking that the ones we want are provided.

ceph/attributes/conf.rb [new file with mode: 0644]
ceph/recipes/conf.rb
ceph/templates/default/ceph.conf.erb

diff --git a/ceph/attributes/conf.rb b/ceph/attributes/conf.rb
new file mode 100644 (file)
index 0000000..8f19f81
--- /dev/null
@@ -0,0 +1 @@
+default["ceph"]["config"] = {}
index 90d0dba3a917efa21aee8972f796fcfbf1eafc6b..582ab5bf07e40373597311c9d510bfc2bf5cf9c3 100644 (file)
@@ -1,10 +1,11 @@
+raise "fsid must be set in config" if node["ceph"]["config"]['fsid'].nil?
+raise "mon_initial_members must be set in config" if node["ceph"]["config"]['mon_initial_members'].nil?
+
 mon_addresses = get_mon_addresses()
 
 template '/etc/ceph/ceph.conf' do
   source 'ceph.conf.erb'
   variables(
-    :fsid => node["ceph"]["config"]["fsid"],
-    :mon_initial_members => node["ceph"]["config"]["mon_initial_members"],
     :mon_addresses => mon_addresses
   )
   mode '0644'
index dbd81eb2bdfa1daaa7f2dba380580bc3b710ab95..f7f5e02ef22b87a7a1bf2c7e7ae8739f7b9c6926 100644 (file)
@@ -1,5 +1,4 @@
 [global]
-       fsid = <%= @fsid %>
        auth supported = cephx
        keyring = /etc/ceph/$cluster.$name.keyring
 
@@ -8,7 +7,10 @@
        # sections, and come up with names for the mons just to be
        # able to list their addresses
        mon host = <%= @mon_addresses.join(', ') %>
-       mon initial members = <%= @mon_initial_members.join(', ') %>
+
+       <% node['ceph']['config'].each do |k, v| %>
+       <%= k %> = <%= v %>
+       <% end %>
 
 [mon]
        keyring = /var/lib/ceph/mon/$cluster-$id/keyring