Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ceph/ceph-cookbook
...
head fork: ceph/ceph-cookbook
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 08, 2012
Tommi Virtanen Passthrough arbitrary (global) config variables to ceph.conf.
Still sanity checking that the ones we want are provided.
00bf193
Tommi Virtanen Passthrough non-global ceph.conf values in a separate hash.
For example:

  "config-sections": {
    "osd": {
      "osd_journal_size": "3000"
    }
    "osd.42": {
      "debug ms": "20"
    }
  }
b316000
View
2  ceph/attributes/conf.rb
@@ -0,0 +1,2 @@
+default["ceph"]["config"] = {}
+default["ceph"]["config-sections"] = {}
View
5 ceph/recipes/conf.rb
@@ -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'
View
14 ceph/templates/default/ceph.conf.erb
@@ -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
@@ -20,3 +22,11 @@
keyring = /var/lib/ceph/osd/$cluster-$id/keyring
osd journal size = 1000
filestore_xattr_use_omap = true
+
+<% node['ceph']['config-sections'].each do |name, sect| %>
+
+[<%= name %>]
+<% sect.each do |k, v| %>
+<%= k %> = <%= v %>
+<% end %>
+<% end %>

No commit comments for this range

Something went wrong with that request. Please try again.