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

Sets the default version to giant #190

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions attributes/mds.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include_attribute 'ceph'

default['ceph']['mds']['init_style'] = node['init_style']
default['ceph']['mds']['fs']['ceph'] = { 'data_pool' => 'data', 'metadata_pool' => 'metadata' }

case node['platform_family']
when 'debian'
Expand Down
20 changes: 10 additions & 10 deletions attributes/repo.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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'] = 'giant'
default['ceph']['el_add_epel'] = true
default['ceph']['repo_url'] = 'http://ceph.com'
default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras'
Expand All @@ -10,33 +10,33 @@
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://raw.githubusercontent.com/ceph/ceph/master/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://raw.githubusercontent.com/ceph/ceph/master/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']['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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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']['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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/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']['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'] = 'https://raw.githubusercontent.com/ceph/ceph/master/keys/release.asc'
when 'suse'
# (Open)SuSE default repositories
# Chef doesn't make a difference between suse and opensuse
Expand Down
1 change: 1 addition & 0 deletions providers/cephfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def manage_mount(directory, subdir, use_fuse, action)
dump 0
pass 0
action action
not_if "mount | grep \"^ceph-fuse on #{Regexp.escape(directory)}\"" if action == :mount
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mounting fuse-based filesystem does not play well when the system reboots: the fstab entry is mounted again by the system, but the "mount" resource does not see that the volume is mounted and tried mounting again, which fails the chef-run. Interested in more pretty workarounds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chef s3fs mount cookbook checks where the directory is a mountpoint, not specifically that it is an s3fs mountpoint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will replace #170

end
else
mons = mon_addresses.sort.join(',') + ':' + subdir
Expand Down
20 changes: 20 additions & 0 deletions recipes/mds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@

cluster = 'ceph'

if node['ceph']['version'] >= 'giant'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that >= can work with future ceph version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mds pools are not created by default for versions >= giant (before that they were automatically created, so there was no code in the cookbook to create the pools if not present).

After thinking about it, creating the pool "not_if" already exists should be safe with older versions and also future proof. Want me to clean this up?

# doesn't work on non-mon nodes, will need to be moved to lwrp
node['ceph']['mds']['fs'].keys.each do |fs|
metadata_pool = node['ceph']['mds']['fs'][fs]['metadata_pool']
data_pool = node['ceph']['mds']['fs'][fs]['data_pool']

[metadata_pool, data_pool].each do |pool_name|
execute "ensure ceph pool #{pool_name} exists" do
command "ceph osd pool create #{pool_name} 32"
not_if "rados lspools | grep '^#{Regexp.quote(pool_name)}$'"
end
end

execute "ensure cephfs #{fs} exists" do
command "ceph fs new #{fs} #{metadata_pool} #{data_pool}"
not_if "ceph fs ls | grep '^#{Regexp.quote(fs)}$'"
end
end
end

directory "/var/lib/ceph/mds/#{cluster}-#{node['hostname']}" do
owner 'root'
group 'root'
Expand Down