
This cookbook needed to be brought up to the standard of the other cookbooks in the repo. * Adding .gitreview * Normalizing .rubocop.yml * Normalizing Gemfile * Normalizing metadata.rb * Normalizing .gitignore * Adding specs/ directory and spec_helper.rb * Fixed all rubocop errors Change-Id: Ica7c525aae5fbd5c441ce50cff36046c678046d6 Partial-Bug: 1348243
46 lines
1.2 KiB
Ruby
46 lines
1.2 KiB
Ruby
# encoding: UTF-8
|
|
#
|
|
# Author:: Kyle Bader <kyle.bader@dreamhost.com>
|
|
# Cookbook Name:: ceph
|
|
# Recipe:: cephfs
|
|
#
|
|
# Copyright 2011, DreamHost Web Hosting
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
include_recipe 'ceph::conf'
|
|
|
|
name = 'cephfs'
|
|
client_name = "cephfs.#{node['hostname']}"
|
|
filename = "/etc/ceph/ceph.client.#{client_name}.secret"
|
|
|
|
ceph_client name do
|
|
filename filename
|
|
caps('mon' => 'allow r', 'osd' => 'allow rw', 'mds' => 'allow')
|
|
as_keyring false
|
|
end
|
|
|
|
mons = mon_addresses.join(',') + ':/'
|
|
|
|
directory node['ceph']['cephfs_mount']
|
|
|
|
mount node['ceph']['cephfs_mount'] do
|
|
fstype 'ceph'
|
|
device mons
|
|
options "_netdev,name=#{client_name},secretfile=#{filename}"
|
|
dump 0
|
|
pass 0
|
|
action [:mount, :enable]
|
|
not_if { mons.empty? }
|
|
end
|