Fix all rubocop
Use rake instead of strainer add infrastructure file for spiceweasel
This commit is contained in:
parent
8539552cf6
commit
afb859a121
20
.rubocop.yml
20
.rubocop.yml
@ -1,16 +1,28 @@
|
||||
AllCops:
|
||||
Includes:
|
||||
- Berksfile
|
||||
- Gemfile
|
||||
- Rakefile
|
||||
- Thorfile
|
||||
- Guardfile
|
||||
Excludes:
|
||||
- vendor/**
|
||||
|
||||
AlignParameters:
|
||||
ClassLength:
|
||||
Enabled: false
|
||||
Documentation:
|
||||
Enabled: false
|
||||
Encoding:
|
||||
Enabled: false
|
||||
HashSyntax:
|
||||
Enabled: false
|
||||
StringLiterals:
|
||||
Enabled: false
|
||||
LineLength:
|
||||
Enabled: false
|
||||
MethodLength:
|
||||
Max: 30
|
||||
Enabled: false
|
||||
SignalException:
|
||||
Enabled: false
|
||||
TrailingComma:
|
||||
Enabled: false
|
||||
WordArray:
|
||||
Enabled: false
|
||||
|
@ -1,8 +1,7 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- 2.0.0
|
||||
before_script:
|
||||
- bundle exec berks install
|
||||
bundler_args: --without integration
|
||||
script:
|
||||
- bundle exec strainer test --except kitchen
|
||||
- bundle exec rake travis
|
||||
|
16
Gemfile
16
Gemfile
@ -1,16 +1,14 @@
|
||||
source "https://rubygems.org"
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem "chef", "~> 11"
|
||||
gem "berkshelf", "~> 2.0.10"
|
||||
gem 'chef', '~> 11'
|
||||
gem 'berkshelf', '~> 2.0.10'
|
||||
|
||||
group :test do
|
||||
gem "chefspec", "~> 3.0.2"
|
||||
gem "foodcritic", "~> 3.0.3"
|
||||
gem "strainer"
|
||||
gem "rubocop"
|
||||
gem 'foodcritic', '~> 3.0'
|
||||
gem 'rubocop'
|
||||
end
|
||||
|
||||
group :integration do
|
||||
gem "test-kitchen", "~> 1.1.1"
|
||||
gem "kitchen-vagrant", "~> 0.14"
|
||||
gem 'test-kitchen', '~> 1.1.1'
|
||||
gem 'kitchen-vagrant', '~> 0.14'
|
||||
end
|
||||
|
47
Rakefile
Normal file
47
Rakefile
Normal file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env rake
|
||||
|
||||
# Style tests. Rubocop and Foodcritic
|
||||
namespace :style do
|
||||
begin
|
||||
require 'rubocop/rake_task'
|
||||
desc 'Run Ruby style checks'
|
||||
Rubocop::RakeTask.new(:ruby)
|
||||
rescue LoadError
|
||||
puts '>>>>> Rubocop gem not loaded, omitting tasks' unless ENV['CI']
|
||||
end
|
||||
|
||||
begin
|
||||
require 'foodcritic'
|
||||
|
||||
desc 'Run Chef style checks'
|
||||
FoodCritic::Rake::LintTask.new(:chef) do |t|
|
||||
t.options = {
|
||||
fail_tags: ['any'],
|
||||
tags: ['~FC003']
|
||||
}
|
||||
end
|
||||
rescue LoadError
|
||||
puts '>>>>> foodcritic gem not loaded, omitting tasks' unless ENV['CI']
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run all style checks'
|
||||
task style: ['style:chef', 'style:ruby']
|
||||
|
||||
# Integration tests. Kitchen.ci
|
||||
namespace :integration do
|
||||
begin
|
||||
require 'kitchen/rake_tasks'
|
||||
|
||||
desc 'Run kitchen integration tests'
|
||||
Kitchen::RakeTasks.new
|
||||
rescue LoadError
|
||||
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run all tests on Travis'
|
||||
task travis: ['style']
|
||||
|
||||
# Default
|
||||
task default: ['style', 'integration:kitchen:all']
|
@ -1,5 +0,0 @@
|
||||
# Strainerfile
|
||||
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK
|
||||
knife test: bundle exec knife cookbook test $COOKBOOK
|
||||
foodcritic: bundle exec foodcritic -f any -t ~FC003 $SANDBOX/$COOKBOOK
|
||||
#chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec
|
@ -1 +1 @@
|
||||
default["ceph"]["cephfs_mount"] = "/ceph"
|
||||
default['ceph']['cephfs_mount'] = '/ceph'
|
||||
|
@ -1,2 +1,2 @@
|
||||
default["ceph"]["config"] = {}
|
||||
default["ceph"]["config-sections"] = {}
|
||||
default['ceph']['config'] = {}
|
||||
default['ceph']['config-sections'] = {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
case node['platform']
|
||||
when 'ubuntu'
|
||||
default["ceph"]["mds"]["init_style"] = "upstart"
|
||||
default['ceph']['mds']['init_style'] = 'upstart'
|
||||
else
|
||||
default["ceph"]["mds"]["init_style"] = "sysvinit"
|
||||
default['ceph']['mds']['init_style'] = 'sysvinit'
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
case node['platform']
|
||||
when 'ubuntu'
|
||||
default["ceph"]["mon"]["init_style"] = "upstart"
|
||||
default['ceph']['mon']['init_style'] = 'upstart'
|
||||
else
|
||||
default["ceph"]["mon"]["init_style"] = "sysvinit"
|
||||
default['ceph']['mon']['init_style'] = 'sysvinit'
|
||||
end
|
||||
default["ceph"]["mon"]["secret_file"] = "/etc/chef/secrets/ceph_mon"
|
||||
default['ceph']['mon']['secret_file'] = '/etc/chef/secrets/ceph_mon'
|
||||
|
@ -1,7 +1,7 @@
|
||||
case node['platform']
|
||||
when 'ubuntu'
|
||||
default["ceph"]["osd"]["init_style"] = "upstart"
|
||||
default['ceph']['osd']['init_style'] = 'upstart'
|
||||
else
|
||||
default["ceph"]["osd"]["init_style"] = "sysvinit"
|
||||
default['ceph']['osd']['init_style'] = 'sysvinit'
|
||||
end
|
||||
default["ceph"]["osd"]["secret_file"] = "/etc/chef/secrets/ceph_osd"
|
||||
default['ceph']['osd']['secret_file'] = '/etc/chef/secrets/ceph_osd'
|
||||
|
@ -17,15 +17,15 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
default["ceph"]["radosgw"]["api_fqdn"] = "localhost"
|
||||
default["ceph"]["radosgw"]["admin_email"] = "admin@example.com"
|
||||
default["ceph"]["radosgw"]["rgw_addr"] = "*:80"
|
||||
default["ceph"]["radosgw"]["rgw_port"] = false
|
||||
default["ceph"]["radosgw"]["webserver_companion"] = "apache2" # can be false
|
||||
default['ceph']["radosgw"]['use_apache_fork'] = true
|
||||
default['ceph']['radosgw']['api_fqdn'] = 'localhost'
|
||||
default['ceph']['radosgw']['admin_email'] = 'admin@example.com'
|
||||
default['ceph']['radosgw']['rgw_addr'] = '*:80'
|
||||
default['ceph']['radosgw']['rgw_port'] = false
|
||||
default['ceph']['radosgw']['webserver_companion'] = 'apache2' # can be false
|
||||
default['ceph']['radosgw']['use_apache_fork'] = true
|
||||
case node['platform']
|
||||
when 'ubuntu'
|
||||
default["ceph"]["radosgw"]["init_style"] = "upstart"
|
||||
default['ceph']['radosgw']['init_style'] = 'upstart'
|
||||
else
|
||||
default["ceph"]["radosgw"]["init_style"] = "sysvinit"
|
||||
default['ceph']['radosgw']['init_style'] = 'sysvinit'
|
||||
end
|
||||
|
@ -1,43 +1,43 @@
|
||||
default['ceph']['branch'] = "stable" # Can be stable, testing or dev.
|
||||
default['ceph']['branch'] = 'stable' # Can be stable, testing or dev.
|
||||
# Major release version to install or gitbuilder branch
|
||||
default['ceph']['version'] = "dumpling"
|
||||
default['ceph']['version'] = 'dumpling'
|
||||
default['ceph']['el_add_epel'] = true
|
||||
default['ceph']['repo_url'] = "http://ceph.com"
|
||||
default['ceph']['extras_repo_url'] = "http://ceph.com/packages/ceph-extras"
|
||||
default['ceph']['repo_url'] = 'http://ceph.com'
|
||||
default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras'
|
||||
default['ceph']['extras_repo'] = false
|
||||
|
||||
case node['platform_family']
|
||||
when "debian"
|
||||
when 'debian'
|
||||
# Debian/Ubuntu default repositories
|
||||
default['ceph']['debian']['stable']['repository'] = "#{node['ceph']['repo_url']}/debian-#{node['ceph']['version']}/"
|
||||
default['ceph']['debian']['stable']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc"
|
||||
default['ceph']['debian']['stable']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
|
||||
default['ceph']['debian']['testing']['repository'] = "#{node['ceph']['repo_url']}/debian-testing/"
|
||||
default['ceph']['debian']['testing']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc"
|
||||
default['ceph']['debian']['testing']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
|
||||
default['ceph']['debian']['dev']['repository'] = "http://gitbuilder.ceph.com/ceph-deb-#{node['lsb']['codename']}-x86_64-basic/ref/#{node['ceph']['version']}"
|
||||
default['ceph']['debian']['dev']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
default['ceph']['debian']['dev']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
default['ceph']['debian']['extras']['repository'] = "#{node['ceph']['extras_repo_url']}/debian/"
|
||||
default['ceph']['debian']['extras']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc"
|
||||
when "rhel"
|
||||
default['ceph']['debian']['extras']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
|
||||
when 'rhel'
|
||||
# Redhat/CentOS default repositories
|
||||
default['ceph']['rhel']['stable']['repository'] = "#{node['ceph']['repo_url']}/rpm-#{node['ceph']['version']}/el6/noarch/ceph-release-1-0.el6.noarch.rpm"
|
||||
default['ceph']['rhel']['testing']['repository'] = "#{node['ceph']['repo_url']}/rpm-testing/el6/x86_64/ceph-release-1-0.el6.noarch.rpm"
|
||||
default['ceph']['rhel']['dev']['repository'] = "http://gitbuilder.ceph.com/ceph-rpm-centos6-x86_64-basic/ref/#{node['ceph']['version']}/x86_64/"
|
||||
default['ceph']['rhel']['dev']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
default['ceph']['rhel']['dev']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
default['ceph']['rhel']['extras']['repository'] = "#{node['ceph']['extras_repo_url']}/rpm/rhel6/x86_64/"
|
||||
default['ceph']['rhel']['extras']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
when "fedora"
|
||||
default['ceph']['rhel']['extras']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
when 'fedora'
|
||||
# Fedora default repositories
|
||||
default['ceph']['fedora']['stable']['repository'] = "#{node['ceph']['repo_url']}/rpm-#{node['ceph']['version']}/fc#{node['platform_version']}/x86_64/ceph-release-1-0.fc#{node['platform_version']}.noarch.rpm"
|
||||
default['ceph']['fedora']['testing']['repository'] = "#{node['ceph']['repo_url']}/rpm-testing/fc#{node['platform_version']}/x86_64/ceph-release-1-0.fc#{node['platform_version']}.noarch.rpm"
|
||||
default['ceph']['fedora']['dev']['repository'] = "http://gitbuilder.ceph.com/ceph-rpm-fc#{node['platform_version']}-x86_64-basic/ref/#{node['ceph']['version']}/RPMS/x86_64/"
|
||||
default['ceph']['fedora']['dev']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
default['ceph']['fedora']['dev']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
default['ceph']['fedora']['extras']['repository'] = "#{node['ceph']['extras_repo_url']}/rpm/fedora#{node['platform_version']}/x86_64/"
|
||||
default['ceph']['fedora']['extras']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
when "suse"
|
||||
default['ceph']['fedora']['extras']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
when 'suse'
|
||||
# (Open)SuSE default repositories
|
||||
# Chef doesn't make a difference between suse and opensuse
|
||||
suse = Mixlib::ShellOut.new("head -n1 /etc/SuSE-release| awk '{print $1}'").run_command.stdout.chomp.downcase
|
||||
suse = "sles" if suse == "suse"
|
||||
suse = 'sles' if suse == 'suse'
|
||||
suse_version = suse << Mixlib::ShellOut.new("grep VERSION /etc/SuSE-release | awk -F'= ' '{print $2}'").run_command.stdout.chomp
|
||||
|
||||
default['ceph']['suse']['stable']['repository'] = "#{node['ceph']['repo_url']}/rpm-#{node['ceph']['version']}/#{suse_version}/x86_64/ceph-release-1-0.#{suse_version}.noarch.rpm"
|
||||
|
6
infrastructure.yml
Normal file
6
infrastructure.yml
Normal file
@ -0,0 +1,6 @@
|
||||
roles:
|
||||
- ceph-mds:
|
||||
- ceph-mon:
|
||||
- ceph-osd:
|
||||
- ceph-radosgw:
|
||||
- ceph-tgt:
|
@ -9,7 +9,7 @@ def get_mon_nodes(extra_search = nil)
|
||||
if crowbar?
|
||||
mon_roles = search(:role, 'name:crowbar-* AND run_list:role\[ceph-mon\]')
|
||||
unless mon_roles.empty?
|
||||
search_string = mon_roles.map { |role_object| "roles:" + role_object.name }.join(' OR ')
|
||||
search_string = mon_roles.map { |role_object| 'roles:' + role_object.name }.join(' OR ')
|
||||
search_string = "(#{search_string}) AND ceph_config_environment:#{node['ceph']['config']['environment']}"
|
||||
end
|
||||
else
|
||||
@ -31,11 +31,11 @@ end
|
||||
def find_node_ip_in_network(network, nodeish = nil)
|
||||
nodeish = node unless nodeish
|
||||
net = IPAddr.new(network)
|
||||
nodeish["network"]["interfaces"].each do |iface, addrs|
|
||||
addrs["addresses"].each do |ip, params|
|
||||
if params['family'].eql?("inet6") && net.include?(ip)
|
||||
nodeish['network']['interfaces'].each do |iface, addrs|
|
||||
addrs['addresses'].each do |ip, params|
|
||||
if params['family'].eql?('inet6') && net.include?(ip)
|
||||
return "[#{ip}]:6789"
|
||||
elsif params['family'].eql?("inet") && net.include?(ip)
|
||||
elsif params['family'].eql?('inet') && net.include?(ip)
|
||||
return "#{ip}:6789"
|
||||
end
|
||||
end
|
||||
@ -46,7 +46,7 @@ end
|
||||
def mon_addresses
|
||||
mon_ips = []
|
||||
|
||||
if File.exists?("/var/run/ceph/ceph-mon.#{node['hostname']}.asok")
|
||||
if File.exist?("/var/run/ceph/ceph-mon.#{node['hostname']}.asok")
|
||||
mon_ips = quorum_members_ips
|
||||
else
|
||||
mons = []
|
||||
@ -57,12 +57,12 @@ def mon_addresses
|
||||
|
||||
mons += get_mon_nodes
|
||||
if crowbar?
|
||||
mon_ips = mons.map { |node| Chef::Recipe::Barclamp::Inventory.get_network_by_type(node, "admin").address }
|
||||
mon_ips = mons.map { |node| Chef::Recipe::Barclamp::Inventory.get_network_by_type(node, 'admin').address }
|
||||
else
|
||||
if node['ceph']['config']['global'] && node['ceph']['config']['global']['public network']
|
||||
mon_ips = mons.map { |nodeish| find_node_ip_in_network(node['ceph']['config']['global']['public network'], nodeish) }
|
||||
else
|
||||
mon_ips = mons.map { |node| node['ipaddress'] + ":6789" }
|
||||
mon_ips = mons.map { |node| node['ipaddress'] + ':6789' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
20
metadata.rb
20
metadata.rb
@ -1,12 +1,12 @@
|
||||
name "ceph"
|
||||
maintainer "Kyle Bader"
|
||||
maintainer_email "kyle.bader@dreamhost.com"
|
||||
license "Apache 2.0"
|
||||
description "Installs/Configures the Ceph distributed filesystem"
|
||||
name 'ceph'
|
||||
maintainer 'Kyle Bader'
|
||||
maintainer_email 'kyle.bader@dreamhost.com'
|
||||
license 'Apache 2.0'
|
||||
description 'Installs/Configures the Ceph distributed filesystem'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "0.2.1"
|
||||
version '0.2.1'
|
||||
|
||||
depends "apache2", ">= 1.1.12"
|
||||
depends "apt"
|
||||
depends "yum", ">= 3.0"
|
||||
depends "yum-epel"
|
||||
depends 'apache2', '>= 1.1.12'
|
||||
depends 'apt'
|
||||
depends 'yum', '>= 3.0'
|
||||
depends 'yum-epel'
|
||||
|
@ -16,9 +16,9 @@ action :add do
|
||||
|
||||
file filename do
|
||||
content file_content
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "640"
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '640'
|
||||
end
|
||||
end
|
||||
|
||||
@ -53,21 +53,21 @@ end
|
||||
|
||||
def auth_set_key(keyname, caps)
|
||||
# find the monitor secret
|
||||
mon_secret = ""
|
||||
mon_secret = ''
|
||||
mons = get_mon_nodes
|
||||
if !mons.empty?
|
||||
mon_secret = mons[0]["ceph"]["monitor-secret"]
|
||||
elsif mons.empty? && node["ceph"]["monitor-secret"]
|
||||
mon_secret = node["ceph"]["monitor-secret"]
|
||||
mon_secret = mons[0]['ceph']['monitor-secret']
|
||||
elsif mons.empty? && node['ceph']['monitor-secret']
|
||||
mon_secret = node['ceph']['monitor-secret']
|
||||
else
|
||||
Chef::Log.warn("No monitor secret found")
|
||||
Chef::Log.warn('No monitor secret found')
|
||||
end
|
||||
# try to add the key
|
||||
cmd = "ceph auth get-or-create #{keyname} #{caps} --name mon. --key='#{mon_secret}'"
|
||||
get_or_create = Mixlib::ShellOut.new(cmd)
|
||||
get_or_create.run_command
|
||||
if get_or_create.stderr.scan(/EINVAL.*but cap.*does not match/)
|
||||
Chef::Log.info("Deleting old key with incorrect caps")
|
||||
Chef::Log.info('Deleting old key with incorrect caps')
|
||||
# delete an old key if it exists and is wrong
|
||||
Mixlib::ShellOut.new("ceph auth del #{keyname}").run_command
|
||||
# try to create again
|
||||
|
@ -1,43 +1,43 @@
|
||||
|
||||
include_recipe "apt"
|
||||
include_recipe 'apt'
|
||||
|
||||
branch = node['ceph']['branch']
|
||||
|
||||
apt_repository "ceph" do
|
||||
repo_name "ceph"
|
||||
apt_repository 'ceph' do
|
||||
repo_name 'ceph'
|
||||
uri node['ceph']['debian'][branch]['repository']
|
||||
distribution node['lsb']['codename'] == "jessie" ? "sid" : node['lsb']['codename']
|
||||
distribution node['lsb']['codename'] == 'jessie' ? 'sid' : node['lsb']['codename']
|
||||
components ['main']
|
||||
key node['ceph']['debian'][branch]['repository_key']
|
||||
end
|
||||
|
||||
apt_repository "ceph-extras" do
|
||||
repo_name "ceph-extras"
|
||||
apt_repository 'ceph-extras' do
|
||||
repo_name 'ceph-extras'
|
||||
uri node['ceph']['debian']['extras']['repository']
|
||||
distribution node['lsb']['codename'] == "jessie" ? "sid" : node['lsb']['codename']
|
||||
distribution node['lsb']['codename'] == 'jessie' ? 'sid' : node['lsb']['codename']
|
||||
components ['main']
|
||||
key node['ceph']['debian']['extras']['repository_key']
|
||||
only_if { node['ceph']['extras_repo'] }
|
||||
end
|
||||
|
||||
if node['ceph']['is_radosgw'] \
|
||||
&& node["ceph"]["radosgw"]["webserver_companion"] == "apache2" \
|
||||
&& node["ceph"]["radosgw"]["use_apache_fork"] == true
|
||||
&& node['ceph']['radosgw']['webserver_companion'] == 'apache2' \
|
||||
&& node['ceph']['radosgw']['use_apache_fork'] == true
|
||||
case node['lsb']['codename']
|
||||
when "precise", "oneiric"
|
||||
apt_repository "ceph-apache2" do
|
||||
repo_name "ceph-apache2"
|
||||
when 'precise', 'oneiric'
|
||||
apt_repository 'ceph-apache2' do
|
||||
repo_name 'ceph-apache2'
|
||||
uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
|
||||
distribution node['lsb']['codename']
|
||||
components ["main"]
|
||||
key "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
components ['main']
|
||||
key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
end
|
||||
apt_repository "ceph-modfastcgi" do
|
||||
repo_name "ceph-modfastcgi"
|
||||
apt_repository 'ceph-modfastcgi' do
|
||||
repo_name 'ceph-modfastcgi'
|
||||
uri "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
|
||||
distribution node['lsb']['codename']
|
||||
components ["main"]
|
||||
key "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc"
|
||||
components ['main']
|
||||
key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
|
||||
end
|
||||
else
|
||||
Log.info("Ceph's Apache and Apache FastCGI forks not available for this distribution")
|
||||
|
@ -17,24 +17,24 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::conf'
|
||||
|
||||
name = "cephfs"
|
||||
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")
|
||||
caps('mon' => 'allow r', 'osd' => 'allow rw', 'mds' => 'allow')
|
||||
as_keyring false
|
||||
end
|
||||
|
||||
mons = mon_addresses.join(",") + ":/"
|
||||
mons = mon_addresses.join(',') + ':/'
|
||||
|
||||
directory node['ceph']['cephfs_mount']
|
||||
|
||||
mount node['ceph']['cephfs_mount'] do
|
||||
fstype "ceph"
|
||||
fstype 'ceph'
|
||||
device mons
|
||||
options "_netdev,name=#{client_name},secretfile=#{filename}"
|
||||
dump 0
|
||||
|
@ -1,10 +1,10 @@
|
||||
fail "fsid must be set in config" if node["ceph"]["config"]['fsid'].nil?
|
||||
fail "mon_initial_members must be set in config" if node["ceph"]["config"]['mon_initial_members'].nil?
|
||||
fail 'fsid must be set in config' if node['ceph']['config']['fsid'].nil?
|
||||
fail 'mon_initial_members must be set in config' if node['ceph']['config']['mon_initial_members'].nil?
|
||||
|
||||
directory "/etc/ceph" do
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "0755"
|
||||
directory '/etc/ceph' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
action :create
|
||||
end
|
||||
|
||||
|
@ -20,28 +20,28 @@
|
||||
packages = []
|
||||
|
||||
case node['platform_family']
|
||||
when "debian"
|
||||
packages = %w{
|
||||
ceph
|
||||
ceph-common
|
||||
}
|
||||
when 'debian'
|
||||
packages = %w(
|
||||
ceph
|
||||
ceph-common
|
||||
)
|
||||
|
||||
if node['ceph']['install_debug']
|
||||
packages_dbg = %w{
|
||||
packages_dbg = %w(
|
||||
ceph-dbg
|
||||
ceph-common-dbg
|
||||
}
|
||||
)
|
||||
packages += packages_dbg
|
||||
end
|
||||
when "rhel", "fedora"
|
||||
packages = %w{
|
||||
ceph
|
||||
}
|
||||
when 'rhel', 'fedora'
|
||||
packages = %w(
|
||||
ceph
|
||||
)
|
||||
|
||||
if node['ceph']['install_debug']
|
||||
packages_dbg = %w{
|
||||
packages_dbg = %w(
|
||||
ceph-debug
|
||||
}
|
||||
)
|
||||
packages += packages_dbg
|
||||
end
|
||||
end
|
||||
|
@ -17,57 +17,57 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include_recipe "ceph::default"
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::default'
|
||||
include_recipe 'ceph::conf'
|
||||
|
||||
cluster = 'ceph'
|
||||
|
||||
directory "/var/lib/ceph/mds/#{cluster}-#{node["hostname"]}" do
|
||||
owner "root"
|
||||
group "root"
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00755
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
ruby_block "create mds client key" do
|
||||
ruby_block 'create mds client key' do
|
||||
block do
|
||||
cmd = "ceph auth get-or-create mds.#{node['hostname']} osd 'allow *' mon 'allow rwx' --name mon. --key='#{node["ceph"]["monitor-secret"]}'"
|
||||
keyring = Mixlib::ShellOut.new(cmd).run_command.stdout
|
||||
|
||||
keyfile = File.new("/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/keyring", "w")
|
||||
keyfile = File.new("/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/keyring", 'w')
|
||||
keyfile.puts(keyring)
|
||||
keyfile.close
|
||||
end
|
||||
end
|
||||
|
||||
file "/var/lib/ceph/mds/#{cluster}-#{node["hostname"]}/done" do
|
||||
owner "root"
|
||||
group "root"
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00644
|
||||
end
|
||||
|
||||
service_type = node["ceph"]["osd"]["init_style"]
|
||||
service_type = node['ceph']['osd']['init_style']
|
||||
|
||||
case service_type
|
||||
when "upstart"
|
||||
filename = "upstart"
|
||||
when 'upstart'
|
||||
filename = 'upstart'
|
||||
else
|
||||
filename = "sysvinit"
|
||||
filename = 'sysvinit'
|
||||
end
|
||||
file "/var/lib/ceph/mds/#{cluster}-#{node["hostname"]}/#{filename}" do
|
||||
owner "root"
|
||||
group "root"
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00644
|
||||
end
|
||||
|
||||
service "ceph_mds" do
|
||||
service 'ceph_mds' do
|
||||
case service_type
|
||||
when "upstart"
|
||||
service_name "ceph-mds-all-starter"
|
||||
when 'upstart'
|
||||
service_name 'ceph-mds-all-starter'
|
||||
provider Chef::Provider::Service::Upstart
|
||||
else
|
||||
service_name "ceph"
|
||||
service_name 'ceph'
|
||||
end
|
||||
action [:enable, :start]
|
||||
supports :restart => true
|
||||
|
@ -14,24 +14,24 @@
|
||||
# different and are created in
|
||||
# /var/lib/ceph/bootstrap-{osd,mds}/ceph.keyring
|
||||
|
||||
include_recipe "ceph::default"
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::default'
|
||||
include_recipe 'ceph::conf'
|
||||
|
||||
service_type = node["ceph"]["mon"]["init_style"]
|
||||
service_type = node['ceph']['mon']['init_style']
|
||||
|
||||
node.default['ceph']['is_mon'] = true
|
||||
|
||||
directory "/var/run/ceph" do
|
||||
owner "root"
|
||||
group "root"
|
||||
directory '/var/run/ceph' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00755
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
directory "/var/lib/ceph/mon/ceph-#{node["hostname"]}" do
|
||||
owner "root"
|
||||
group "root"
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00755
|
||||
recursive true
|
||||
action :create
|
||||
@ -40,17 +40,17 @@ end
|
||||
# TODO: cluster name
|
||||
cluster = 'ceph'
|
||||
|
||||
unless File.exists?("/var/lib/ceph/mon/ceph-#{node["hostname"]}/done")
|
||||
unless File.exist?("/var/lib/ceph/mon/ceph-#{node["hostname"]}/done")
|
||||
keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{node['hostname']}.mon.keyring"
|
||||
|
||||
if node['ceph']['encrypted_data_bags']
|
||||
secret = Chef::EncryptedDataBagItem.load_secret(node["ceph"]["mon"]["secret_file"])
|
||||
monitor_secret = Chef::EncryptedDataBagItem.load("ceph", "mon", secret)["secret"]
|
||||
secret = Chef::EncryptedDataBagItem.load_secret(node['ceph']['mon']['secret_file'])
|
||||
monitor_secret = Chef::EncryptedDataBagItem.load('ceph', 'mon', secret)['secret']
|
||||
else
|
||||
monitor_secret = node["ceph"]["monitor-secret"]
|
||||
monitor_secret = node['ceph']['monitor-secret']
|
||||
end
|
||||
|
||||
execute "format as keyring" do
|
||||
execute 'format as keyring' do
|
||||
command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{monitor_secret}' --cap mon 'allow *'"
|
||||
creates "#{Chef::Config[:file_cache_path]}/#{cluster}-#{node['hostname']}.mon.keyring"
|
||||
end
|
||||
@ -59,34 +59,34 @@ unless File.exists?("/var/lib/ceph/mon/ceph-#{node["hostname"]}/done")
|
||||
command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'"
|
||||
end
|
||||
|
||||
ruby_block "finalise" do
|
||||
ruby_block 'finalise' do
|
||||
block do
|
||||
["done", service_type].each do |ack|
|
||||
::File.open("/var/lib/ceph/mon/ceph-#{node["hostname"]}/#{ack}", "w").close
|
||||
['done', service_type].each do |ack|
|
||||
::File.open("/var/lib/ceph/mon/ceph-#{node["hostname"]}/#{ack}", 'w').close
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if service_type == "upstart"
|
||||
service "ceph-mon" do
|
||||
if service_type == 'upstart'
|
||||
service 'ceph-mon' do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action :enable
|
||||
end
|
||||
service "ceph-mon-all" do
|
||||
service 'ceph-mon-all' do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
supports :status => true
|
||||
action [:enable, :start]
|
||||
end
|
||||
end
|
||||
|
||||
service "ceph_mon" do
|
||||
service 'ceph_mon' do
|
||||
case service_type
|
||||
when "upstart"
|
||||
service_name "ceph-mon-all-starter"
|
||||
when 'upstart'
|
||||
service_name 'ceph-mon-all-starter'
|
||||
provider Chef::Provider::Service::Upstart
|
||||
else
|
||||
service_name "ceph"
|
||||
service_name 'ceph'
|
||||
end
|
||||
supports :restart => true, :status => true
|
||||
action [:enable, :start]
|
||||
@ -103,11 +103,11 @@ end
|
||||
# created,
|
||||
# We store it when it is created
|
||||
unless node['ceph']['encrypted_data_bags']
|
||||
ruby_block "get osd-bootstrap keyring" do
|
||||
ruby_block 'get osd-bootstrap keyring' do
|
||||
block do
|
||||
run_out = ""
|
||||
run_out = ''
|
||||
while run_out.empty?
|
||||
run_out = Mixlib::ShellOut.new("ceph auth get-key client.bootstrap-osd").run_command.stdout.strip
|
||||
run_out = Mixlib::ShellOut.new('ceph auth get-key client.bootstrap-osd').run_command.stdout.strip
|
||||
sleep 2
|
||||
end
|
||||
node.override['ceph']['bootstrap_osd_key'] = run_out
|
||||
|
@ -31,8 +31,8 @@
|
||||
# }
|
||||
# ]
|
||||
|
||||
include_recipe "ceph::default"
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::default'
|
||||
include_recipe 'ceph::conf'
|
||||
|
||||
package 'gdisk' do
|
||||
action :upgrade
|
||||
@ -43,50 +43,50 @@ package 'cryptsetup' do
|
||||
only_if { node['dmcrypt'] }
|
||||
end
|
||||
|
||||
service_type = node["ceph"]["osd"]["init_style"]
|
||||
mons = node['ceph']['encrypted_data_bags'] ? get_mon_nodes : get_mon_nodes("ceph_bootstrap_osd_key:*")
|
||||
service_type = node['ceph']['osd']['init_style']
|
||||
mons = node['ceph']['encrypted_data_bags'] ? get_mon_nodes : get_mon_nodes('ceph_bootstrap_osd_key:*')
|
||||
|
||||
return "No ceph-mon found." if mons.empty?
|
||||
return 'No ceph-mon found.' if mons.empty?
|
||||
|
||||
directory "/var/lib/ceph/bootstrap-osd" do
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "0755"
|
||||
directory '/var/lib/ceph/bootstrap-osd' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
end
|
||||
|
||||
# TODO: cluster name
|
||||
cluster = 'ceph'
|
||||
|
||||
if node['ceph']['encrypted_data_bags']
|
||||
secret = Chef::EncryptedDataBagItem.load_secret(node["ceph"]["osd"]["secret_file"])
|
||||
osd_secret = Chef::EncryptedDataBagItem.load("ceph", "osd", secret)["secret"]
|
||||
secret = Chef::EncryptedDataBagItem.load_secret(node['ceph']['osd']['secret_file'])
|
||||
osd_secret = Chef::EncryptedDataBagItem.load('ceph', 'osd', secret)['secret']
|
||||
else
|
||||
osd_secret = mons[0]["ceph"]["bootstrap_osd_key"]
|
||||
osd_secret = mons[0]['ceph']['bootstrap_osd_key']
|
||||
end
|
||||
|
||||
execute "format as keyring" do
|
||||
execute 'format as keyring' do
|
||||
command "ceph-authtool '/var/lib/ceph/bootstrap-osd/#{cluster}.keyring' --create-keyring --name=client.bootstrap-osd --add-key='#{osd_secret}'"
|
||||
creates "/var/lib/ceph/bootstrap-osd/#{cluster}.keyring"
|
||||
end
|
||||
|
||||
if crowbar?
|
||||
node["crowbar"]["disks"].each do |disk, data|
|
||||
node['crowbar']['disks'].each do |disk, data|
|
||||
execute "ceph-disk-prepare #{disk}" do
|
||||
command "ceph-disk-prepare /dev/#{disk}"
|
||||
only_if { node["crowbar"]["disks"][disk]["usage"] == "Storage" }
|
||||
notifies :run, "execute[udev trigger]", :immediately
|
||||
only_if { node['crowbar']['disks'][disk]['usage'] == 'Storage' }
|
||||
notifies :run, 'execute[udev trigger]', :immediately
|
||||
end
|
||||
|
||||
ruby_block "set disk usage for #{disk}" do
|
||||
block do
|
||||
node.set["crowbar"]["disks"][disk]["usage"] = "ceph-osd"
|
||||
node.set['crowbar']['disks'][disk]['usage'] = 'ceph-osd'
|
||||
node.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
execute "udev trigger" do
|
||||
command "udevadm trigger --subsystem-match=block --action=add"
|
||||
execute 'udev trigger' do
|
||||
command 'udevadm trigger --subsystem-match=block --action=add'
|
||||
action :nothing
|
||||
end
|
||||
else
|
||||
@ -99,25 +99,25 @@ else
|
||||
# osd/$cluster-$id)
|
||||
# - $cluster should always be ceph
|
||||
# - The --dmcrypt option will be available starting w/ Cuttlefish
|
||||
if !node["ceph"]["osd_devices"].nil?
|
||||
devices = node["ceph"]["osd_devices"]
|
||||
if !node['ceph']['osd_devices'].nil?
|
||||
devices = node['ceph']['osd_devices']
|
||||
|
||||
devices = Hash[(0...devices.size).zip devices] unless devices.kind_of? Hash
|
||||
|
||||
devices.each do |index, osd_device|
|
||||
unless osd_device["status"].nil?
|
||||
unless osd_device['status'].nil?
|
||||
Log.info("osd: osd_device #{osd_device} has already been setup.")
|
||||
next
|
||||
end
|
||||
|
||||
directory osd_device["device"] do # ~FC022
|
||||
owner "root"
|
||||
group "root"
|
||||
directory osd_device['device'] do # ~FC022
|
||||
owner 'root'
|
||||
group 'root'
|
||||
recursive true
|
||||
only_if { osd_device["type"] == "directory" }
|
||||
only_if { osd_device['type'] == 'directory' }
|
||||
end
|
||||
|
||||
dmcrypt = osd_device["encrypted"] == true ? '--dmcrypt' : ''
|
||||
dmcrypt = osd_device['encrypted'] == true ? '--dmcrypt' : ''
|
||||
|
||||
execute "ceph-disk-prepare on #{osd_device['device']}" do
|
||||
command "ceph-disk-prepare #{dmcrypt} #{osd_device['device']} #{osd_device['journal']}"
|
||||
@ -126,7 +126,7 @@ else
|
||||
end
|
||||
|
||||
execute "ceph-disk-activate #{osd_device['device']}" do
|
||||
only_if { osd_device["type"] == "directory" }
|
||||
only_if { osd_device['type'] == 'directory' }
|
||||
end
|
||||
|
||||
# we add this status to the node env
|
||||
@ -135,19 +135,19 @@ else
|
||||
# future.
|
||||
ruby_block "save osd_device status #{index}" do
|
||||
block do
|
||||
node.normal["ceph"]["osd_devices"][index]["status"] = "deployed"
|
||||
node.normal['ceph']['osd_devices'][index]['status'] = 'deployed'
|
||||
node.save
|
||||
end
|
||||
action :nothing
|
||||
end
|
||||
end
|
||||
service "ceph_osd" do
|
||||
service 'ceph_osd' do
|
||||
case service_type
|
||||
when "upstart"
|
||||
service_name "ceph-osd-all-starter"
|
||||
when 'upstart'
|
||||
service_name 'ceph-osd-all-starter'
|
||||
provider Chef::Provider::Service::Upstart
|
||||
else
|
||||
service_name "ceph"
|
||||
service_name 'ceph'
|
||||
end
|
||||
action [:enable, :start]
|
||||
supports :restart => true
|
||||
|
@ -20,21 +20,21 @@
|
||||
node.default['ceph']['is_radosgw'] = true
|
||||
|
||||
case node['platform_family']
|
||||
when "debian"
|
||||
packages = %w{
|
||||
when 'debian'
|
||||
packages = %w(
|
||||
radosgw
|
||||
}
|
||||
)
|
||||
|
||||
if node['ceph']['install_debug']
|
||||
packages_dbg = %w{
|
||||
packages_dbg = %w(
|
||||
radosgw-dbg
|
||||
}
|
||||
)
|
||||
packages += packages_dbg
|
||||
end
|
||||
when "rhel", "fedora", "suse"
|
||||
packages = %w{
|
||||
when 'rhel', 'fedora', 'suse'
|
||||
packages = %w(
|
||||
ceph-radosgw
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
packages.each do |pkg|
|
||||
@ -43,36 +43,36 @@ packages.each do |pkg|
|
||||
end
|
||||
end
|
||||
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::conf'
|
||||
|
||||
if !::File.exists?("/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}/done")
|
||||
if node["ceph"]["radosgw"]["webserver_companion"]
|
||||
if node['ceph']['radosgw']['webserver_companion']
|
||||
include_recipe "ceph::radosgw_#{node["ceph"]["radosgw"]["webserver_companion"]}"
|
||||
end
|
||||
|
||||
ceph_client "radosgw" do
|
||||
caps("mon" => "allow rw", "osd" => "allow rwx")
|
||||
ceph_client 'radosgw' do
|
||||
caps('mon' => 'allow rw', 'osd' => 'allow rwx')
|
||||
end
|
||||
|
||||
file "/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}/done" do
|
||||
action :create
|
||||
end
|
||||
|
||||
service "radosgw" do
|
||||
case node["ceph"]["radosgw"]["init_style"]
|
||||
when "upstart"
|
||||
service_name "radosgw-all-starter"
|
||||
service 'radosgw' do
|
||||
case node['ceph']['radosgw']['init_style']
|
||||
when 'upstart'
|
||||
service_name 'radosgw-all-starter'
|
||||
provider Chef::Provider::Service::Upstart
|
||||
else
|
||||
if node['platform'] == "debian"
|
||||
service_name "radosgw"
|
||||
if node['platform'] == 'debian'
|
||||
service_name 'radosgw'
|
||||
else
|
||||
service_name "ceph-radosgw"
|
||||
service_name 'ceph-radosgw'
|
||||
end
|
||||
end
|
||||
supports :restart => true
|
||||
action [:enable, :start]
|
||||
end
|
||||
else
|
||||
Log.info("Rados Gateway already deployed")
|
||||
Log.info('Rados Gateway already deployed')
|
||||
end
|
||||
|
@ -18,16 +18,16 @@
|
||||
# limitations under the License.
|
||||
|
||||
case node['platform_family']
|
||||
when "debian", "suse"
|
||||
packages = %w{
|
||||
when 'debian', 'suse'
|
||||
packages = %w(
|
||||
apache2
|
||||
libapache2-mod-fastcgi
|
||||
}
|
||||
when "rhel", "fedora"
|
||||
packages = %w{
|
||||
)
|
||||
when 'rhel', 'fedora'
|
||||
packages = %w(
|
||||
httpd
|
||||
mod_fastcgi
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
packages.each do |pkg|
|
||||
@ -38,61 +38,61 @@ end
|
||||
|
||||
# For EL, delete the current fastcgi configuration
|
||||
# and set the correct owners for dirs and logs
|
||||
d_owner = d_group = "root"
|
||||
if node['platform_family'] == "rhel"
|
||||
d_owner = d_group = 'root'
|
||||
if node['platform_family'] == 'rhel'
|
||||
file "#{node['apache']['dir']}/conf.d/fastcgi.conf" do
|
||||
action :delete
|
||||
backup false
|
||||
end
|
||||
d_owner = d_group = "apache"
|
||||
d_owner = d_group = 'apache'
|
||||
end
|
||||
|
||||
%W{ /var/run/ceph
|
||||
/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}
|
||||
/var/lib/apache2/
|
||||
}.each do |dir|
|
||||
%W(/var/run/ceph
|
||||
/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}
|
||||
/var/lib/apache2/
|
||||
).each do |dir|
|
||||
directory dir do
|
||||
owner d_owner
|
||||
group d_group
|
||||
mode "0755"
|
||||
mode '0755'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
end
|
||||
|
||||
file "/var/log/radosgw/radosgw.log" do
|
||||
file '/var/log/radosgw/radosgw.log' do
|
||||
owner d_owner
|
||||
group d_group
|
||||
mode "0644"
|
||||
mode '0644'
|
||||
action :create
|
||||
end
|
||||
|
||||
include_recipe "apache2"
|
||||
include_recipe 'apache2'
|
||||
|
||||
apache_module "fastcgi" do
|
||||
apache_module 'fastcgi' do
|
||||
conf true
|
||||
end
|
||||
|
||||
apache_module "rewrite" do
|
||||
apache_module 'rewrite' do
|
||||
conf false
|
||||
end
|
||||
|
||||
web_app "rgw" do
|
||||
template "rgw.conf.erb"
|
||||
web_app 'rgw' do
|
||||
template 'rgw.conf.erb'
|
||||
server_name node['ceph']['radosgw']['api_fqdn']
|
||||
admin_email node['ceph']['radosgw']['admin_email']
|
||||
ceph_rgw_addr node['ceph']['radosgw']['rgw_addr']
|
||||
end
|
||||
|
||||
service "apache2" do
|
||||
service 'apache2' do
|
||||
action :restart
|
||||
end
|
||||
|
||||
template "/var/www/s3gw.fcgi" do
|
||||
source "s3gw.fcgi.erb"
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "0755"
|
||||
template '/var/www/s3gw.fcgi' do
|
||||
source 's3gw.fcgi.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
variables(
|
||||
:ceph_rgw_client => "client.radosgw.#{node['hostname']}"
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
case node['platform_family']
|
||||
when "debian"
|
||||
include_recipe "ceph::apt"
|
||||
when "rhel", "suse"
|
||||
include_recipe "ceph::rpm"
|
||||
when 'debian'
|
||||
include_recipe 'ceph::apt'
|
||||
when 'rhel', 'suse'
|
||||
include_recipe 'ceph::rpm'
|
||||
else
|
||||
fail "not supported"
|
||||
fail 'not supported'
|
||||
end
|
||||
|
@ -1,23 +1,23 @@
|
||||
platform_family = node['platform_family']
|
||||
|
||||
case platform_family
|
||||
when "rhel"
|
||||
include_recipe "yum-epel" if node['ceph']['el_add_epel']
|
||||
when 'rhel'
|
||||
include_recipe 'yum-epel' if node['ceph']['el_add_epel']
|
||||
end
|
||||
|
||||
branch = node['ceph']['branch']
|
||||
if branch == "dev" && platform_family != "centos" && platform_family != "fedora"
|
||||
if branch == 'dev' && platform_family != 'centos' && platform_family != 'fedora'
|
||||
fail "Dev branch for #{platform_family} is not yet supported"
|
||||
end
|
||||
|
||||
repo = node['ceph'][platform_family][branch]['repository']
|
||||
|
||||
yum_repository "ceph" do
|
||||
yum_repository 'ceph' do
|
||||
baseurl repo
|
||||
gpgkey node['ceph'][platform_family]['dev']['repository_key'] if branch == "dev"
|
||||
gpgkey node['ceph'][platform_family]['dev']['repository_key'] if branch == 'dev'
|
||||
end
|
||||
|
||||
yum_repository "ceph-extra" do
|
||||
yum_repository 'ceph-extra' do
|
||||
baseurl node['ceph'][platform_family]['extras']['repository']
|
||||
gpgkey node['ceph'][platform_family]['extras']['repository_key']
|
||||
only_if { node['ceph']['extras_repo'] }
|
||||
|
@ -20,14 +20,14 @@
|
||||
node.default['ceph']['extras_repo'] = true
|
||||
|
||||
case node['platform_family']
|
||||
when "debian"
|
||||
packages = %w{
|
||||
when 'debian'
|
||||
packages = %w(
|
||||
tgt
|
||||
}
|
||||
when "rhel", "fedora"
|
||||
packages = %w{
|
||||
)
|
||||
when 'rhel', 'fedora'
|
||||
packages = %w(
|
||||
scsi-target-utils
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
packages.each do |pkg|
|
||||
@ -36,15 +36,15 @@ packages.each do |pkg|
|
||||
end
|
||||
end
|
||||
|
||||
include_recipe "ceph::conf"
|
||||
include_recipe 'ceph::conf'
|
||||
# probably needs the key
|
||||
service "tgt" do
|
||||
if node['platform'] == "ubuntu"
|
||||
service 'tgt' do
|
||||
if node['platform'] == 'ubuntu'
|
||||
# The ceph version of tgt does not provide an Upstart script
|
||||
provider Chef::Provider::Service::Init::Debian
|
||||
service_name "tgt"
|
||||
service_name 'tgt'
|
||||
else
|
||||
service_name "tgt"
|
||||
service_name 'tgt'
|
||||
end
|
||||
supports :restart => true
|
||||
action [:enable, :start]
|
||||
|
@ -2,7 +2,7 @@ actions :add
|
||||
default_action :add
|
||||
|
||||
attribute :name, :kind_of => String, :name_attribute => true
|
||||
attribute :caps, :kind_of => Hash, :default => { "mon" => "allow r", "osd" => "allow r" }
|
||||
attribute :caps, :kind_of => Hash, :default => { 'mon' => 'allow r', 'osd' => 'allow r' }
|
||||
|
||||
# Whether to store the secret in a keyring file or a plain secret file
|
||||
attribute :as_keyring, :kind_of => [TrueClass, FalseClass], :default => true
|
||||
|
@ -5,4 +5,4 @@
|
||||
"recipe[ceph::repo]",
|
||||
"recipe[ceph::mds]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
name "ceph-mds"
|
||||
description "Ceph Metadata Server"
|
||||
run_list(
|
||||
'recipe[ceph::repo]',
|
||||
'recipe[ceph::mds]'
|
||||
)
|
@ -5,4 +5,4 @@
|
||||
"recipe[ceph::repo]",
|
||||
"recipe[ceph::mon]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
name "ceph-mon"
|
||||
description "Ceph Monitor"
|
||||
run_list(
|
||||
'recipe[ceph::repo]',
|
||||
'recipe[ceph::mon]'
|
||||
)
|
@ -5,4 +5,4 @@
|
||||
"recipe[ceph::repo]",
|
||||
"recipe[ceph::osd]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
name "ceph-osd"
|
||||
description "Ceph Object Storage Device"
|
||||
run_list(
|
||||
'recipe[ceph::repo]',
|
||||
'recipe[ceph::osd]'
|
||||
)
|
@ -5,4 +5,4 @@
|
||||
"recipe[ceph::repo]",
|
||||
"recipe[ceph::radosgw]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
name "ceph-radosgw"
|
||||
description "Ceph RADOS Gateway"
|
||||
run_list(
|
||||
'recipe[ceph::repo]',
|
||||
'recipe[ceph::radosgw]'
|
||||
)
|
8
roles/ceph-tgt.json
Normal file
8
roles/ceph-tgt.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "ceph-tgt",
|
||||
"description": "Ceph iSCSI Target",
|
||||
"run_list": [
|
||||
"recipe[ceph::repo]",
|
||||
"recipe[ceph::tgt]"
|
||||
]
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
name "ceph-tgt"
|
||||
description "Ceph iSCSI Target"
|
||||
run_list(
|
||||
'recipe[ceph::repo]',
|
||||
'recipe[ceph::tgt]'
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user