Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace ceph-disk-* with ceph-disk analogs #218

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1b07a1d
replace ceph-disk-* with ceph-disk analogs
fzylogic Oct 13, 2015
35828cc
allow per-mon public nets
fzylogic Oct 20, 2015
3d7241e
allow the use of supernets
fzylogic Oct 21, 2015
2edc83a
Revert "allow per-mon public nets"
fzylogic Oct 21, 2015
2f7be8c
bump version
fzylogic Oct 21, 2015
880f871
test for the string "true" in osd.rb
fzylogic Nov 2, 2015
7d20ab8
test for the string "true" in osd.rb
fzylogic Nov 2, 2015
872af6c
changed default paths from http://ceph.com to http://download.ceph.co…
Dec 23, 2015
7567098
removed comment
Dec 23, 2015
cefc4b0
Merge remote-tracking branch 'ceph/pr/220' into robbat2
robbat2 May 12, 2016
57e92da
libraries/utils: ensure new enough kernels for hammer/jewel.
robbat2 May 12, 2016
764bb7f
install: allow fine-grained control of exact version.
robbat2 May 12, 2016
5b18a0c
Merge remote-tracking branch 'ceph/pr/218' into robbat2
robbat2 May 12, 2016
6fe9f87
Merge pull request #1 from dreamhost/robbat2
fzylogic May 12, 2016
5babd0e
enable but do not start the -starter service
fzylogic Jun 6, 2016
e5641e8
bump the cookbook version
fzylogic Jun 6, 2016
c39bf9b
update for jewel
oddomatik Feb 15, 2017
ae115d3
Update conf.rb
oddomatik Feb 15, 2017
d1a2fa4
update osd permissions for jewel
oddomatik Feb 15, 2017
e23bed3
Merge pull request #2 from oddomatik/patch-1
fzylogic Feb 15, 2017
6f9e8e1
Merge pull request #3 from oddomatik/patch-1
fzylogic Feb 15, 2017
4b75378
Install the packages early on
Feb 15, 2017
23a3422
Merge pull request #4 from drwahl/ipv6test
fzylogic Feb 15, 2017
e9fcdb5
Use UID instead of name for chown
Feb 15, 2017
d9ff983
Merge pull request #5 from drwahl/ipv6test
fzylogic Feb 15, 2017
168a593
bumps default version to jewel
oddomatik Feb 16, 2017
a260687
Merge pull request #7 from oddomatik/patch-4
drwahl Feb 16, 2017
de87205
honor package_action in ceph::default
fzylogic Feb 16, 2017
facf574
switch back to using the ceph user by name
fzylogic Feb 16, 2017
c341996
install packages before conf
Feb 16, 2017
104b751
Merge pull request #8 from drwahl/ipv6test
fzylogic Feb 16, 2017
9f25037
Set owner/group default attribute
Feb 16, 2017
c090050
use ceph user to run mon create etc commands.
oddomatik Feb 16, 2017
38dc6b2
Merge pull request #9 from drwahl/ipv6test
drwahl Feb 16, 2017
3d22dfb
Merge pull request #10 from oddomatik/patch-5
oddomatik Feb 16, 2017
b1ce61f
Revert "use ceph user to run mon create etc commands."
oddomatik Feb 16, 2017
4819c9f
Merge pull request #11 from fzylogic/revert-10-patch-5
oddomatik Feb 16, 2017
60f434a
Update user, owner, and group to Ceph user
oddomatik Feb 16, 2017
f64dcb4
update user, owner, group for jewel
oddomatik Feb 16, 2017
54989c0
Merge pull request #12 from fzylogic/oddomatik-patch-1
drwahl Feb 16, 2017
3851080
Merge pull request #13 from fzylogic/ipv6test
drwahl Feb 16, 2017
02559b8
generate monitor bootstrap keys as root
fzylogic Feb 16, 2017
652668b
fix the monitor keyring bootstrapping
fzylogic Feb 16, 2017
ff8ab90
fix one more mon bootstrap bug
fzylogic Feb 16, 2017
a80c384
initial support for ceph-mgr
fzylogic Aug 31, 2017
e9cf9fe
stupid bugfix
fzylogic Aug 31, 2017
43e27ac
include mgr attributes
fzylogic Aug 31, 2017
f6fbfb4
typo fix
fzylogic Aug 31, 2017
94fdc61
create the mgr data directory
fzylogic Aug 31, 2017
5844830
fix another copypasta bug
fzylogic Aug 31, 2017
6cd3d94
test explicitly enabling the ceph monitor service unit
fzylogic Aug 31, 2017
c6c1d36
mgr upstart bugfix
fzylogic Aug 31, 2017
a16eb1b
further systemd support
fzylogic Aug 31, 2017
6ff755e
copypasta
fzylogic Aug 31, 2017
83952af
fix permissions on mgr key
fzylogic Aug 31, 2017
57f65f1
fix the user keyword
fzylogic Aug 31, 2017
e463fcf
fix mds directory permissions
fzylogic Oct 16, 2017
cbaa7ed
fix mds keyring permissions
fzylogic Oct 16, 2017
18852aa
Add logic to check if mon_host override is defined
oddomatik Jan 3, 2020
bfadd91
increment version
oddomatik Jan 3, 2020
ea7c725
Merge pull request #16 from fzylogic/ceph-mon-ip-override
drwahl Jan 3, 2020
8dff6dd
Fix logic in mon_host definition
oddomatik Jan 3, 2020
91b67cc
increment version
oddomatik Jan 3, 2020
370b3c9
Merge pull request #17 from fzylogic/mon-host-fix
oddomatik Jan 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
default['ceph']['install_debug'] = false
default['ceph']['encrypted_data_bags'] = false

default['ceph']['owner'] = 'ceph'
default['ceph']['group'] = 'ceph'

default['ceph']['install_repo'] = true

default['ceph']['user_pools'] = []
Expand Down
12 changes: 12 additions & 0 deletions attributes/mgr.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include_attribute 'ceph'

default['ceph']['mgr']['init_style'] = node['init_style']

case node['platform_family']
when 'debian'
packages = ['ceph-mgr']
packages += debug_packages(packages) if node['ceph']['install_debug']
default['ceph']['mgr']['packages'] = packages
else
default['ceph']['mgr']['packages'] = []
end
1 change: 1 addition & 0 deletions attributes/mon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
default['ceph']['mon']['init_style'] = node['ceph']['init_style']

default['ceph']['mon']['secret_file'] = '/etc/chef/secrets/ceph_mon'
default['ceph']['mon']['keyring_path'] = '/etc/ceph'

case node['platform_family']
when 'debian', 'rhel', 'fedora'
Expand Down
30 changes: 16 additions & 14 deletions attributes/repo.rb
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
default['ceph']['branch'] = 'stable' # Can be stable, testing or dev.
# Major release version to install or gitbuilder branch
default['ceph']['version'] = 'firefly'
default['ceph']['version'] = 'jewel'
default['ceph']['el_add_epel'] = true
default['ceph']['repo_url'] = 'http://ceph.com'
default['ceph']['repo_url'] = 'http://download.ceph.com'
default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras'
default['ceph']['extras_repo'] = false
default['ceph']['package_action'] = :install
default['ceph']['exactversion'] = nil

case node['platform_family']
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'] = "#{node['ceph']['repo_url']}/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'] = "#{node['ceph']['repo_url']}/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'] = "#{node['ceph']['extras_repo_url']}/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'
default['ceph']['debian']['extras']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
when 'rhel'
# Redhat/CentOS default repositories
default['ceph']['rhel']['stable']['repository'] = "#{node['ceph']['repo_url']}/rpm-#{node['ceph']['version']}/el6/x86_64/"
default['ceph']['rhel']['stable']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
default['ceph']['rhel']['stable']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
default['ceph']['rhel']['testing']['repository'] = "#{node['ceph']['repo_url']}/rpm-testing/el6/x86_64/"
default['ceph']['rhel']['testing']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
default['ceph']['rhel']['testing']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
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'] = "#{node['ceph']['repo_url']}/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/release.asc'
default['ceph']['rhel']['extras']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.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/"
default['ceph']['fedora']['stable']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
default['ceph']['fedora']['stable']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
default['ceph']['fedora']['testing']['repository'] = "#{node['ceph']['repo_url']}/rpm-testing/fc#{node['platform_version']}/x86_64/"
default['ceph']['fedora']['testing']['repository_key'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
default['ceph']['fedora']['testing']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
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'] = "#{node['ceph']['repo_url']}/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/release.asc'
default['ceph']['fedora']['extras']['repository_key'] = "#{node['ceph']['repo_url']}/keys/release.asc"
when 'suse'
# (Open)SuSE default repositories
# Chef doesn't make a difference between suse and opensuse
Expand Down
2 changes: 1 addition & 1 deletion libraries/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def ip4_address_in_network?(ip, params, net)
end

def ip6_address_in_network?(ip, params, net)
net.contains?(ip) && params['prefixlen'].to_i == net.bits
net.contains?(ip)
end

def ip_address_to_ceph_address(ip, params)
Expand Down
17 changes: 16 additions & 1 deletion libraries/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def cephfs_requires_fuse
'cuttlefish' => 3.9,
'dumpling' => 3.9,
'emperor' => 3.9,
'firefly' => 3.15
'firefly' => 3.15,
'giant' => 3.15,
'hammer' => 4.1,
'jewel' => 4.5,
}
min_versions.default = 3.15

Expand All @@ -33,3 +36,15 @@ def cephfs_requires_fuse
true
end
end

def ceph_exactversion(pkg)
pkg_ver = nil
if node['ceph']['exactversion'] then
if node['ceph']['exactversion'].respond_to?(:has_key?) then
pkg_ver = node['ceph']['exactversion']['default'] if node['ceph']['exactversion'].has_key?('default')
pkg_ver = node['ceph']['exactversion'][pkg] if node['ceph']['exactversion'].has_key?(pkg)
else
pkg_ver = node['ceph']['exactversion']
end
end
end
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs/Configures the Ceph distributed filesystem'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.9.3'
version '0.9.37'

depends 'apache2', '>= 1.1.12'
depends 'apt'
Expand Down
6 changes: 5 additions & 1 deletion recipes/cephfs_install.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
include_recipe 'ceph'

node['ceph']['cephfs']['packages'].each do |pck|
package pck
package pck do
action node['ceph']['package_action']
v = ceph_exactversion(pck)
version v if v
end
end

# Update the fuse.ceph helper for pre-firefly
Expand Down
8 changes: 6 additions & 2 deletions recipes/conf.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# fail 'mon_initial_members must be set in config' if node['ceph']['config']['mon_initial_members'].nil?

include_recipe 'ceph'

unless node['ceph']['config']['fsid']
Chef::Log.warn('We are genereting a new uuid for fsid')
require 'securerandom'
Expand All @@ -8,8 +10,8 @@
end

directory '/etc/ceph' do
owner 'root'
group 'root'
owner 'ceph'
group 'ceph'
mode '0755'
action :create
end
Expand All @@ -22,5 +24,7 @@
:is_rgw => node['ceph']['is_radosgw']
}
}
owner 'ceph'
group 'ceph'
mode '0644'
end
7 changes: 5 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
include_recipe 'ceph::repo' if node['ceph']['install_repo']
include_recipe 'ceph::conf'

# Tools needed by cookbook
node['ceph']['packages'].each do |pck|
package pck
package pck do
action node['ceph']['package_action']
end
end

include_recipe 'ceph::conf'

chef_gem 'netaddr'
8 changes: 5 additions & 3 deletions recipes/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
end
end

packages.each do |pkg|
package pkg do
action :install
packages.each do |pck|
package pck do
action node['ceph']['package_action']
v = ceph_exactversion(pck)
version v if v
end
end
18 changes: 11 additions & 7 deletions recipes/mds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
cluster = 'ceph'

directory "/var/lib/ceph/mds/#{cluster}-#{node['hostname']}" do
owner 'root'
group 'root'
owner node['ceph']['owner']
group node['ceph']['group']
mode 00755
recursive true
action :create
Expand All @@ -34,6 +34,8 @@
caps('osd' => 'allow *', 'mon' => 'allow rwx')
keyname "mds.#{node['hostname']}"
filename "/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/keyring"
owner node['ceph']['owner']
group node['ceph']['group']
end

file "/var/lib/ceph/mds/#{cluster}-#{node['hostname']}/done" do
Expand All @@ -56,14 +58,16 @@
mode 00644
end

service 'ceph_mds' do
case service_type
when 'upstart'
if service_type == 'upstart'
service 'ceph_mds' do
service_name 'ceph-mds-all-starter'
provider Chef::Provider::Service::Upstart
else
service_name 'ceph'
end
action [:enable, :start]
supports :restart => true
elsif service_type == 'systemd'
unit = "ceph-mds@#{node['hostname']}.service"
systemd_unit unit do
action :enable
end
end
6 changes: 5 additions & 1 deletion recipes/mds_install.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include_recipe 'ceph'

node['ceph']['mds']['packages'].each do |pck|
package pck
package pck do
action node['ceph']['package_action']
v = ceph_exactversion(pck)
version v if v
end
end
72 changes: 72 additions & 0 deletions recipes/mgr.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Author:: Jeremy Hanmer <[email protected]>
# Cookbook Name:: ceph
# Recipe:: mgr
#
# Copyright 2017, 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'
include_recipe 'ceph::mgr_install'

cluster = 'ceph'

directory "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}" do
owner 'root'
group 'root'
mode 00755
recursive true
action :create
end

ceph_client 'mgr' do
caps('osd' => 'allow *', 'mon' => 'allow profile mgr', 'mds' => 'allow *')
keyname "mgr.#{node['hostname']}"
filename "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/keyring"
owner node['ceph']['owner']
group node['ceph']['group']
end

file "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/done" do
owner 'root'
group 'root'
mode 00644
end

service_type = node['ceph']['osd']['init_style']

case service_type
when 'upstart'
filename = 'upstart'
else
filename = 'sysvinit'
end
file "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/#{filename}" do
owner 'root'
group 'root'
mode 00644
end

if service_type == 'upstart'
service 'ceph_mgr' do
service_name 'ceph-mgr'
action [:enable, :start]
supports :restart => true
end
elsif service_type == 'systemd'
unit = "ceph-mgr@#{node['hostname']}.service"
systemd_unit unit do
action :enable
end
end
9 changes: 9 additions & 0 deletions recipes/mgr_install.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include_recipe 'ceph'

node['ceph']['mgr']['packages'].each do |pck|
package pck do
action node['ceph']['package_action']
v = ceph_exactversion(pck)
version v if v
end
end
Loading