From 1b07a1d2798e306df2cb0c04f5379c19d2565076 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Tue, 13 Oct 2015 23:49:06 +0000 Subject: [PATCH 01/48] replace ceph-disk-* with ceph-disk analogs With infernalis, ceph-disk-[prepare|activate] are gone and were just dumb wrappers anyway. Replace calls to them with appropriate calls to ceph-disk. --- metadata.rb | 2 +- recipes/osd.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/metadata.rb b/metadata.rb index e3b9d2b..4e96683 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.4' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/osd.rb b/recipes/osd.rb index d07f161..0ccb9d8 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -63,8 +63,8 @@ if crowbar? node['crowbar']['disks'].each do |disk, _data| - execute "ceph-disk-prepare #{disk}" do - command "ceph-disk-prepare /dev/#{disk}" + 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 end @@ -82,9 +82,9 @@ action :nothing end else - # Calling ceph-disk-prepare is sufficient for deploying an OSD - # After ceph-disk-prepare finishes, the new device will be caught - # by udev which will run ceph-disk-activate on it (udev will map + # Calling `ceph-disk prepare` is sufficient for deploying an OSD + # After `ceph-disk prepare` finishes, the new device will be caught + # by udev which will run `ceph-disk activate` on it (udev will map # the devices if dm-crypt is used). # IMPORTANT: # - Always use the default path for OSD (i.e. /var/lib/ceph/ @@ -111,13 +111,13 @@ 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']}" + execute "ceph-disk prepare on #{osd_device['device']}" do + command "ceph-disk prepare #{dmcrypt} #{osd_device['device']} #{osd_device['journal']}" action :run notifies :create, "ruby_block[save osd_device status #{index}]", :immediately end - execute "ceph-disk-activate #{osd_device['device']}" do + execute "ceph-disk activate #{osd_device['device']}" do only_if { osd_device['type'] == 'directory' } end From 35828ccbc7b931bfea34ebf17b20e53fdb930f73 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Tue, 20 Oct 2015 16:59:42 -0700 Subject: [PATCH 02/48] allow per-mon public nets --- libraries/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/default.rb b/libraries/default.rb index 297da37..c9d261e 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -114,7 +114,7 @@ def mon_addresses 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) } + mon_ips = mons.map { |nodeish| find_node_ip_in_network(nodeish['ceph']['config']['global']['public network'], nodeish) } else mon_ips = mons.map { |node| node['ipaddress'] + ':6789' } end From 3d7241e74902a36eb010a6021ade4e5cff931e1b Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Tue, 20 Oct 2015 17:19:11 -0700 Subject: [PATCH 03/48] allow the use of supernets --- libraries/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/default.rb b/libraries/default.rb index c9d261e..d03ad44 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -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) From 2edc83aa2a52c66392003eafde63e8e8f5602ef9 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Tue, 20 Oct 2015 17:26:56 -0700 Subject: [PATCH 04/48] Revert "allow per-mon public nets" This reverts commit 35828ccbc7b931bfea34ebf17b20e53fdb930f73. --- libraries/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/default.rb b/libraries/default.rb index d03ad44..4bddd52 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -114,7 +114,7 @@ def mon_addresses 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(nodeish['ceph']['config']['global']['public network'], nodeish) } + 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' } end From 2f7be8cdca1fd5fd9dcb3bfcf02683cf03d9364c Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Tue, 20 Oct 2015 17:41:48 -0700 Subject: [PATCH 05/48] bump version --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index e3b9d2b..4e96683 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.4' depends 'apache2', '>= 1.1.12' depends 'apt' From 880f871ddb8385aca1f3617c55a5a901d9742510 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 2 Nov 2015 15:27:59 -0800 Subject: [PATCH 06/48] test for the string "true" in osd.rb --- metadata.rb | 2 +- recipes/osd.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 4e96683..8cfe0d6 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.4' +version '0.9.5' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/osd.rb b/recipes/osd.rb index 0ccb9d8..1687c7f 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -109,7 +109,7 @@ 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']}" From 7d20ab87dc374ca0f13d5c7ad309fa7693ab9535 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 2 Nov 2015 15:39:53 -0800 Subject: [PATCH 07/48] test for the string "true" in osd.rb --- metadata.rb | 2 +- recipes/osd.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 4e96683..4cd9561 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.4' +version '0.9.6' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/osd.rb b/recipes/osd.rb index d07f161..75f7892 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -109,7 +109,7 @@ 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']}" From 872af6ca6ee49a6de0d68bf2db0dcdd9e132785b Mon Sep 17 00:00:00 2001 From: Gerhard Sulzberger Date: Wed, 23 Dec 2015 09:15:19 +0100 Subject: [PATCH 08/48] changed default paths from http://ceph.com to http://download.ceph.com for repository, release key and autobuild key download --- attributes/repo.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/attributes/repo.rb b/attributes/repo.rb index f215493..4bd3b37 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -2,41 +2,41 @@ # Major release version to install or gitbuilder branch default['ceph']['version'] = 'firefly' 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://download.ceph.com' +default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras' #GONE is no longer available on this server default['ceph']['extras_repo'] = false 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 From 75670985894d116c35cd280ecbbdc70610d43a45 Mon Sep 17 00:00:00 2001 From: Gerhard Sulzberger Date: Wed, 23 Dec 2015 13:49:31 +0100 Subject: [PATCH 09/48] removed comment --- attributes/repo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/repo.rb b/attributes/repo.rb index 4bd3b37..8e651b1 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -3,7 +3,7 @@ default['ceph']['version'] = 'firefly' default['ceph']['el_add_epel'] = true default['ceph']['repo_url'] = 'http://download.ceph.com' -default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras' #GONE is no longer available on this server +default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras' default['ceph']['extras_repo'] = false case node['platform_family'] From 57e92da8d1220b6627fb89a822372254a421d3e5 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Thu, 12 May 2016 14:11:10 -0700 Subject: [PATCH 10/48] libraries/utils: ensure new enough kernels for hammer/jewel. Signed-off-by: Robin H. Johnson --- libraries/utils.rb | 5 ++++- metadata.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/utils.rb b/libraries/utils.rb index bac9248..fea66c6 100644 --- a/libraries/utils.rb +++ b/libraries/utils.rb @@ -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 diff --git a/metadata.rb b/metadata.rb index 4cd9561..ddef854 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.6' +version '0.9.7' depends 'apache2', '>= 1.1.12' depends 'apt' From 764bb7f2fda50060488855f98ec306971b70448c Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Thu, 12 May 2016 14:35:15 -0700 Subject: [PATCH 11/48] install: allow fine-grained control of exact version. Signed-off-by: Robin H. Johnson --- attributes/repo.rb | 2 ++ libraries/utils.rb | 12 ++++++++++++ metadata.rb | 2 +- recipes/cephfs_install.rb | 6 +++++- recipes/install.rb | 8 +++++--- recipes/mds_install.rb | 6 +++++- recipes/mon_install.rb | 6 +++++- recipes/osd_install.rb | 6 +++++- recipes/radosgw_install.rb | 6 +++++- 9 files changed, 45 insertions(+), 9 deletions(-) diff --git a/attributes/repo.rb b/attributes/repo.rb index 8e651b1..5ce47be 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -5,6 +5,8 @@ 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' diff --git a/libraries/utils.rb b/libraries/utils.rb index fea66c6..2c5d64e 100644 --- a/libraries/utils.rb +++ b/libraries/utils.rb @@ -36,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 diff --git a/metadata.rb b/metadata.rb index ddef854..9c4daef 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.7' +version '0.9.11' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/cephfs_install.rb b/recipes/cephfs_install.rb index 434e22b..af5eea6 100644 --- a/recipes/cephfs_install.rb +++ b/recipes/cephfs_install.rb @@ -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 diff --git a/recipes/install.rb b/recipes/install.rb index 7d1eb57..d03fe46 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -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 diff --git a/recipes/mds_install.rb b/recipes/mds_install.rb index a04ee5a..a85f565 100644 --- a/recipes/mds_install.rb +++ b/recipes/mds_install.rb @@ -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 diff --git a/recipes/mon_install.rb b/recipes/mon_install.rb index a125f35..1144de1 100644 --- a/recipes/mon_install.rb +++ b/recipes/mon_install.rb @@ -1,5 +1,9 @@ include_recipe 'ceph' node['ceph']['mon']['packages'].each do |pck| - package pck + package pck do + action node['ceph']['package_action'] + v = ceph_exactversion(pck) + version v if v + end end diff --git a/recipes/osd_install.rb b/recipes/osd_install.rb index f368db3..538229f 100644 --- a/recipes/osd_install.rb +++ b/recipes/osd_install.rb @@ -1,5 +1,9 @@ include_recipe 'ceph' node['ceph']['osd']['packages'].each do |pck| - package pck + package pck do + action node['ceph']['package_action'] + v = ceph_exactversion(pck) + version v if v + end end diff --git a/recipes/radosgw_install.rb b/recipes/radosgw_install.rb index 5dde1d7..0b16d54 100644 --- a/recipes/radosgw_install.rb +++ b/recipes/radosgw_install.rb @@ -1,5 +1,9 @@ include_recipe 'ceph' node['ceph']['radosgw']['packages'].each do |pck| - package pck + package pck do + action node['ceph']['package_action'] + v = ceph_exactversion(pck) + version v if v + end end From 5babd0edb3fe8cabeaf6be13eaca0fdeb205d7dd Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 6 Jun 2016 16:14:43 -0700 Subject: [PATCH 12/48] enable but do not start the -starter service --- recipes/osd.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/osd.rb b/recipes/osd.rb index 1687c7f..b2aa4b7 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -141,7 +141,7 @@ else service_name 'ceph' end - action [:enable, :start] + action [:enable] supports :restart => true end else From e5641e88684739567e1bba04c4ad1badb6d9e42b Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 6 Jun 2016 16:15:04 -0700 Subject: [PATCH 13/48] bump the cookbook version --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 5a66856..48b8ddf 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.12' +version '0.9.13' depends 'apache2', '>= 1.1.12' depends 'apt' From c39bf9b7773436ceda809fcbe79db70586cf5e0e Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Wed, 15 Feb 2017 11:36:08 -0800 Subject: [PATCH 14/48] update for jewel daemon now runs as "ceph" user. --- recipes/mon.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/mon.rb b/recipes/mon.rb index 4da92e0..ac23307 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -22,16 +22,16 @@ service_type = node['ceph']['mon']['init_style'] directory '/var/run/ceph' do - owner 'root' - group 'root' + owner 'ceph' + group 'ceph' mode 00755 recursive true action :create end directory "/var/lib/ceph/mon/ceph-#{node['hostname']}" do - owner 'root' - group 'root' + owner 'ceph' + group 'ceph' mode 00755 recursive true action :create From ae115d3336e22057f672c2ab1ebda20162309811 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Wed, 15 Feb 2017 11:43:57 -0800 Subject: [PATCH 15/48] Update conf.rb --- recipes/conf.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/conf.rb b/recipes/conf.rb index 43d6a54..35d2957 100644 --- a/recipes/conf.rb +++ b/recipes/conf.rb @@ -8,8 +8,8 @@ end directory '/etc/ceph' do - owner 'root' - group 'root' + owner 'ceph' + group 'ceph' mode '0755' action :create end @@ -22,5 +22,7 @@ :is_rgw => node['ceph']['is_radosgw'] } } + owner 'ceph' + group 'ceph' mode '0644' end From d1a2fa4879a48aa460c1d260d6e7dc4609d3a1f2 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Wed, 15 Feb 2017 11:45:13 -0800 Subject: [PATCH 16/48] update osd permissions for jewel ceph daemons now run as ceph:ceph --- recipes/osd.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/osd.rb b/recipes/osd.rb index 1687c7f..75f4138 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -46,8 +46,8 @@ service_type = node['ceph']['osd']['init_style'] directory '/var/lib/ceph/bootstrap-osd' do - owner 'root' - group 'root' + owner 'ceph' + group 'ceph' mode '0755' end @@ -103,8 +103,8 @@ end directory osd_device['device'] do # ~FC022 - owner 'root' - group 'root' + owner 'ceph' + group 'ceph' recursive true only_if { osd_device['type'] == 'directory' } end From 4b75378b74a4ab07ec600315b5275086f66de723 Mon Sep 17 00:00:00 2001 From: David Wahlstrom Date: Wed, 15 Feb 2017 12:10:22 -0800 Subject: [PATCH 17/48] Install the packages early on Parts of the conf recipe reference the "ceph" user, which comes from the package. Therefore, the packages need to be installed before running the conf recipe. --- metadata.rb | 2 +- recipes/default.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 48b8ddf..9aa3f47 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.13' +version '0.9.14' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/default.rb b/recipes/default.rb index 936bc33..dfb3035 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,9 +1,10 @@ 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 end +include_recipe 'ceph::conf' + chef_gem 'netaddr' From e9fcdb517af9765b79eac043bf63f50b42936577 Mon Sep 17 00:00:00 2001 From: David Wahlstrom Date: Wed, 15 Feb 2017 14:46:31 -0800 Subject: [PATCH 18/48] Use UID instead of name for chown When chown-ing files/folder (during ceph::conf), use the UID instead of the name. This should fix a race condition we're seeing between package installs and config file deploys. --- recipes/conf.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/conf.rb b/recipes/conf.rb index 35d2957..8050903 100644 --- a/recipes/conf.rb +++ b/recipes/conf.rb @@ -8,8 +8,8 @@ end directory '/etc/ceph' do - owner 'ceph' - group 'ceph' + owner '64045' + group '64045' mode '0755' action :create end @@ -22,7 +22,7 @@ :is_rgw => node['ceph']['is_radosgw'] } } - owner 'ceph' - group 'ceph' + owner '64045' + group '64045' mode '0644' end From 168a5936e1e027fff15297576e9df2e7d62a3743 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Thu, 16 Feb 2017 09:08:26 -0800 Subject: [PATCH 19/48] bumps default version to jewel --- attributes/repo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/repo.rb b/attributes/repo.rb index f215493..ff2705f 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -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'] = 'jewel' default['ceph']['el_add_epel'] = true default['ceph']['repo_url'] = 'http://ceph.com' default['ceph']['extras_repo_url'] = 'http://ceph.com/packages/ceph-extras' From de87205b10c597becc7498df2d555d2613004c61 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 16 Feb 2017 10:46:07 -0800 Subject: [PATCH 20/48] honor package_action in ceph::default --- metadata.rb | 2 +- recipes/default.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 9aa3f47..d6667e6 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.14' +version '0.9.15' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/default.rb b/recipes/default.rb index dfb3035..5a54593 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -2,7 +2,9 @@ # 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' From facf57455f17714c7e52c85860aca051ec35d7fb Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 16 Feb 2017 10:55:27 -0800 Subject: [PATCH 21/48] switch back to using the ceph user by name --- metadata.rb | 2 +- recipes/conf.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/metadata.rb b/metadata.rb index d6667e6..0f0b134 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.15' +version '0.9.16' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/conf.rb b/recipes/conf.rb index 8050903..35d2957 100644 --- a/recipes/conf.rb +++ b/recipes/conf.rb @@ -8,8 +8,8 @@ end directory '/etc/ceph' do - owner '64045' - group '64045' + owner 'ceph' + group 'ceph' mode '0755' action :create end @@ -22,7 +22,7 @@ :is_rgw => node['ceph']['is_radosgw'] } } - owner '64045' - group '64045' + owner 'ceph' + group 'ceph' mode '0644' end From c34199635d6bd7ce84786dd3b99d880f58f6a574 Mon Sep 17 00:00:00 2001 From: David Wahlstrom Date: Thu, 16 Feb 2017 11:44:28 -0800 Subject: [PATCH 22/48] install packages before conf Packages must be installed before ceph::conf is called. ceph::conf references the ceph user, which comes from the package and as such, will never be able to complete unless the packages are installed first. --- metadata.rb | 2 +- recipes/conf.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 0f0b134..b48274c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.16' +version '0.9.17' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/conf.rb b/recipes/conf.rb index 35d2957..588187f 100644 --- a/recipes/conf.rb +++ b/recipes/conf.rb @@ -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' From 9f2503793078ae486369dea90062e1aecf17a7af Mon Sep 17 00:00:00 2001 From: David Wahlstrom Date: Thu, 16 Feb 2017 12:16:07 -0800 Subject: [PATCH 23/48] Set owner/group default attribute Setting ceph:ceph for the default user/group. This should help file/dir ownership during install/setup. --- attributes/default.rb | 3 +++ metadata.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 2b7e541..7d41ad8 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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'] = [] diff --git a/metadata.rb b/metadata.rb index b48274c..036ca10 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.17' +version '0.9.18' depends 'apache2', '>= 1.1.12' depends 'apt' From c090050cbc4253f84907c3a6426704af2da18efe Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Thu, 16 Feb 2017 12:18:21 -0800 Subject: [PATCH 24/48] use ceph user to run mon create etc commands. --- recipes/mon.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/recipes/mon.rb b/recipes/mon.rb index ac23307..7ea18a5 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -30,8 +30,8 @@ end directory "/var/lib/ceph/mon/ceph-#{node['hostname']}" do - owner 'ceph' - group 'ceph' + owner node['ceph']['owner'] + group node['ceph']['group'] mode 00755 recursive true action :create @@ -45,6 +45,8 @@ execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring + owner node['ceph']['owner'] + group node['ceph']['group'] only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end @@ -52,6 +54,8 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring + owner node['ceph']['owner'] + group node['ceph']['group'] not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive @@ -59,6 +63,8 @@ execute 'add bootstrap-osd key to keyring' do command lazy { "ceph-authtool '#{keyring}' --name=client.bootstrap-osd --add-key='#{osd_secret}' --cap mon 'allow profile bootstrap-osd' --cap osd 'allow profile bootstrap-osd'" } + owner node['ceph']['owner'] + group node['ceph']['group'] only_if { node['ceph']['encrypted_data_bags'] && osd_secret } end @@ -75,6 +81,8 @@ execute 'ceph-mon mkfs' do command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'" + owner node['ceph']['owner'] + group node['ceph']['group'] end ruby_block 'finalise' do @@ -112,6 +120,8 @@ mon_addresses.each do |addr| execute "peer #{addr}" do command "ceph --admin-daemon '/var/run/ceph/ceph-mon.#{node['hostname']}.asok' add_bootstrap_peer_hint #{addr}" + owner node['ceph']['owner'] + group node['ceph']['group'] ignore_failure true end end From b1ce61f4e2ee25ee32586050c0aabdea27bb4413 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Thu, 16 Feb 2017 12:33:17 -0800 Subject: [PATCH 25/48] Revert "use ceph user to run mon create etc commands." --- recipes/mon.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/recipes/mon.rb b/recipes/mon.rb index 7ea18a5..ac23307 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -30,8 +30,8 @@ end directory "/var/lib/ceph/mon/ceph-#{node['hostname']}" do - owner node['ceph']['owner'] - group node['ceph']['group'] + owner 'ceph' + group 'ceph' mode 00755 recursive true action :create @@ -45,8 +45,6 @@ execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring - owner node['ceph']['owner'] - group node['ceph']['group'] only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end @@ -54,8 +52,6 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring - owner node['ceph']['owner'] - group node['ceph']['group'] not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive @@ -63,8 +59,6 @@ execute 'add bootstrap-osd key to keyring' do command lazy { "ceph-authtool '#{keyring}' --name=client.bootstrap-osd --add-key='#{osd_secret}' --cap mon 'allow profile bootstrap-osd' --cap osd 'allow profile bootstrap-osd'" } - owner node['ceph']['owner'] - group node['ceph']['group'] only_if { node['ceph']['encrypted_data_bags'] && osd_secret } end @@ -81,8 +75,6 @@ execute 'ceph-mon mkfs' do command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'" - owner node['ceph']['owner'] - group node['ceph']['group'] end ruby_block 'finalise' do @@ -120,8 +112,6 @@ mon_addresses.each do |addr| execute "peer #{addr}" do command "ceph --admin-daemon '/var/run/ceph/ceph-mon.#{node['hostname']}.asok' add_bootstrap_peer_hint #{addr}" - owner node['ceph']['owner'] - group node['ceph']['group'] ignore_failure true end end From 60f434a836bf7436c80a41535c9c94727f86c4a0 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Thu, 16 Feb 2017 12:38:50 -0800 Subject: [PATCH 26/48] Update user, owner, and group to Ceph user --- recipes/mon.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/recipes/mon.rb b/recipes/mon.rb index ac23307..42fa562 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -22,16 +22,16 @@ service_type = node['ceph']['mon']['init_style'] directory '/var/run/ceph' do - owner 'ceph' - group 'ceph' + owner node['ceph']['owner'] + group node['ceph']['group'] mode 00755 recursive true action :create end directory "/var/lib/ceph/mon/ceph-#{node['hostname']}" do - owner 'ceph' - group 'ceph' + owner node['ceph']['owner'] + group node['ceph']['group'] mode 00755 recursive true action :create @@ -45,6 +45,8 @@ execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring + user node['ceph']['owner'] + group node['ceph']['group'] only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end @@ -52,6 +54,8 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring + user node['ceph']['owner'] + group node['ceph']['group'] not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive @@ -75,6 +79,8 @@ execute 'ceph-mon mkfs' do command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'" + user node['ceph']['owner'] + group node['ceph']['group'] end ruby_block 'finalise' do From f64dcb4fd2f80e3c76a6388ebbcd6193d3b045ab Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Thu, 16 Feb 2017 12:40:58 -0800 Subject: [PATCH 27/48] update user, owner, group for jewel --- recipes/mon.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/recipes/mon.rb b/recipes/mon.rb index ac23307..42fa562 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -22,16 +22,16 @@ service_type = node['ceph']['mon']['init_style'] directory '/var/run/ceph' do - owner 'ceph' - group 'ceph' + owner node['ceph']['owner'] + group node['ceph']['group'] mode 00755 recursive true action :create end directory "/var/lib/ceph/mon/ceph-#{node['hostname']}" do - owner 'ceph' - group 'ceph' + owner node['ceph']['owner'] + group node['ceph']['group'] mode 00755 recursive true action :create @@ -45,6 +45,8 @@ execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring + user node['ceph']['owner'] + group node['ceph']['group'] only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end @@ -52,6 +54,8 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring + user node['ceph']['owner'] + group node['ceph']['group'] not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive @@ -75,6 +79,8 @@ execute 'ceph-mon mkfs' do command "ceph-mon --mkfs -i #{node['hostname']} --keyring '#{keyring}'" + user node['ceph']['owner'] + group node['ceph']['group'] end ruby_block 'finalise' do From 02559b8ece22719f04d4b0fa607df15de5e5a88c Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 16 Feb 2017 13:28:28 -0800 Subject: [PATCH 28/48] generate monitor bootstrap keys as root --- metadata.rb | 2 +- recipes/mon.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/metadata.rb b/metadata.rb index 036ca10..5eae4be 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.18' +version '0.9.19' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mon.rb b/recipes/mon.rb index 42fa562..7534331 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -45,8 +45,8 @@ execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring - user node['ceph']['owner'] - group node['ceph']['group'] + user 'root' + group 'root' only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end @@ -54,8 +54,8 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring - user node['ceph']['owner'] - group node['ceph']['group'] + user 'root' + group 'root' not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive From 652668b112feefc09e8aff842077c7638b961ad7 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 16 Feb 2017 14:02:44 -0800 Subject: [PATCH 29/48] fix the monitor keyring bootstrapping --- attributes/mon.rb | 1 + metadata.rb | 2 +- recipes/mon.rb | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/attributes/mon.rb b/attributes/mon.rb index 5d146e6..8078162 100644 --- a/attributes/mon.rb +++ b/attributes/mon.rb @@ -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' diff --git a/metadata.rb b/metadata.rb index 5eae4be..a474e71 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.19' +version '0.9.20' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mon.rb b/recipes/mon.rb index 7534331..c256a5b 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -40,13 +40,13 @@ # TODO: cluster name cluster = 'ceph' -keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{node['hostname']}.mon.keyring" +keyring = "#{node['ceph']['mon']['keyring_path']}/#{node['ceph']['cluster']}.mon.keyring" execute 'format mon-secret as keyring' do # ~FC009 command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring - user 'root' - group 'root' + user node['ceph']['owner'] + group node['ceph']['group'] only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end From ff8ab90d3471a51af7446a305e82ef7704688a99 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 16 Feb 2017 14:34:28 -0800 Subject: [PATCH 30/48] fix one more mon bootstrap bug --- metadata.rb | 2 +- recipes/mon.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata.rb b/metadata.rb index a474e71..1b6f0f8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.20' +version '0.9.21' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mon.rb b/recipes/mon.rb index c256a5b..b9b4566 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -54,8 +54,8 @@ execute 'generate mon-secret as keyring' do # ~FC009 command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring - user 'root' - group 'root' + user node['ceph']['owner'] + group node['ceph']['group'] not_if { mon_secret } notifies :create, 'ruby_block[save mon_secret]', :immediately sensitive true if Chef::Resource::Execute.method_defined? :sensitive From a80c384580360b6400a3102c4c89ab4ad1897430 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 11:13:31 -0700 Subject: [PATCH 31/48] initial support for ceph-mgr --- metadata.rb | 2 +- recipes/mgr.rb | 56 ++++++++++++++++++++++++++++++++++++++++++ recipes/mgr_install.rb | 9 +++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 recipes/mgr.rb create mode 100644 recipes/mgr_install.rb diff --git a/metadata.rb b/metadata.rb index 1b6f0f8..2635581 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.21' +version '0.9.22' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb new file mode 100644 index 0000000..282e5fc --- /dev/null +++ b/recipes/mgr.rb @@ -0,0 +1,56 @@ +# +# Author:: Jeremy Hanmer +# 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' + +ceph_client 'mgr' do + caps('osd' => 'allow *', 'mon' => 'allow profile mgr', 'mds' => 'allow *') + keyname "mds.#{node['hostname']}" + filename "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/keyring" +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 + +service 'ceph_mgr' do + case service_type + service_name 'ceph-mgr' + action [:enable, :start] + supports :restart => true +end diff --git a/recipes/mgr_install.rb b/recipes/mgr_install.rb new file mode 100644 index 0000000..fb16dd2 --- /dev/null +++ b/recipes/mgr_install.rb @@ -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 From e9cf9fec0db6698c1702b088af574d73b2b2a825 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 11:36:55 -0700 Subject: [PATCH 32/48] stupid bugfix --- metadata.rb | 2 +- recipes/mgr.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 2635581..98746df 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.22' +version '0.9.23' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 282e5fc..5e230de 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -49,7 +49,6 @@ end service 'ceph_mgr' do - case service_type service_name 'ceph-mgr' action [:enable, :start] supports :restart => true From 43e27acd1bee99ad469b0e0c3c68dbc9c3abf07c Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 11:40:51 -0700 Subject: [PATCH 33/48] include mgr attributes --- attributes/mgr.rb | 12 ++++++++++++ metadata.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 attributes/mgr.rb diff --git a/attributes/mgr.rb b/attributes/mgr.rb new file mode 100644 index 0000000..b637c62 --- /dev/null +++ b/attributes/mgr.rb @@ -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']['mds']['packages'] = packages +else + default['ceph']['mds']['packages'] = [] +end diff --git a/metadata.rb b/metadata.rb index 98746df..a23baf1 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.23' +version '0.9.24' depends 'apache2', '>= 1.1.12' depends 'apt' From f6fbfb4a6b7a5a3002156dbc3610446d5659e734 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 11:44:06 -0700 Subject: [PATCH 34/48] typo fix --- attributes/mgr.rb | 4 ++-- metadata.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attributes/mgr.rb b/attributes/mgr.rb index b637c62..681f776 100644 --- a/attributes/mgr.rb +++ b/attributes/mgr.rb @@ -6,7 +6,7 @@ when 'debian' packages = ['ceph-mgr'] packages += debug_packages(packages) if node['ceph']['install_debug'] - default['ceph']['mds']['packages'] = packages + default['ceph']['mgr']['packages'] = packages else - default['ceph']['mds']['packages'] = [] + default['ceph']['mgr']['packages'] = [] end diff --git a/metadata.rb b/metadata.rb index a23baf1..67e50de 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.24' +version '0.9.25' depends 'apache2', '>= 1.1.12' depends 'apt' From 94fdc6119d917b2971732d58e0f40d33834c9592 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 12:06:20 -0700 Subject: [PATCH 35/48] create the mgr data directory --- metadata.rb | 2 +- recipes/mgr.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 67e50de..46a467e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.25' +version '0.9.26' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 5e230de..64b4df1 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -22,6 +22,14 @@ 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 "mds.#{node['hostname']}" From 584483076645195f6a7607412a7546476a65d6d1 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 13:11:50 -0700 Subject: [PATCH 36/48] fix another copypasta bug --- metadata.rb | 2 +- recipes/mgr.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 46a467e..d60501b 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.26' +version '0.9.27' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 64b4df1..60f244d 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -32,7 +32,7 @@ ceph_client 'mgr' do caps('osd' => 'allow *', 'mon' => 'allow profile mgr', 'mds' => 'allow *') - keyname "mds.#{node['hostname']}" + keyname "mgr.#{node['hostname']}" filename "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/keyring" end From 6cd3d9434eedd668f944fb58125dd4315618b01a Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 13:55:19 -0700 Subject: [PATCH 37/48] test explicitly enabling the ceph monitor service unit --- metadata.rb | 2 +- recipes/mon.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index d60501b..c5e90c6 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.27' +version '0.9.28' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mon.rb b/recipes/mon.rb index b9b4566..643e50e 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -101,6 +101,11 @@ supports :status => true action [:enable, :start] end +elsif service_type == 'systemd' + unit = "ceph-mon@#{node['hostname']}.service" + systemd_unit unit do + action :enable + end end service 'ceph_mon' do From c6c1d36f3d3ac4e3aabda9071feaf110900cbde5 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 14:01:38 -0700 Subject: [PATCH 38/48] mgr upstart bugfix --- metadata.rb | 2 +- recipes/mgr.rb | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/metadata.rb b/metadata.rb index c5e90c6..16c9389 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.28' +version '0.9.29' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 60f244d..b48e19c 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -56,8 +56,10 @@ mode 00644 end -service 'ceph_mgr' do - service_name 'ceph-mgr' - action [:enable, :start] - supports :restart => true +if service_type == 'upstart' + service 'ceph_mgr' do + service_name 'ceph-mgr' + action [:enable, :start] + supports :restart => true + end end From a16eb1bb91d2cd67286630f07ada5a27d132692e Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 14:08:50 -0700 Subject: [PATCH 39/48] further systemd support --- metadata.rb | 2 +- recipes/mds.rb | 12 +++++++----- recipes/mgr.rb | 5 +++++ recipes/osd.rb | 16 +++++++++------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/metadata.rb b/metadata.rb index 16c9389..31bd704 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.29' +version '0.9.30' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mds.rb b/recipes/mds.rb index aedff15..0c2a65e 100644 --- a/recipes/mds.rb +++ b/recipes/mds.rb @@ -56,14 +56,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-mon@#{node['hostname']}.service" + systemd_unit unit do + action :enable + end end diff --git a/recipes/mgr.rb b/recipes/mgr.rb index b48e19c..61833ce 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -62,4 +62,9 @@ action [:enable, :start] supports :restart => true end +elsif service_type == 'systemd' + unit = "ceph-mon@#{node['hostname']}.service" + systemd_unit unit do + action :enable + end end diff --git a/recipes/osd.rb b/recipes/osd.rb index 05102ca..16a6a04 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -133,16 +133,18 @@ action :nothing end end - service 'ceph_osd' do - case service_type - when 'upstart' + if service_type == 'upstart' + service 'ceph_osd' do service_name 'ceph-osd-all-starter' provider Chef::Provider::Service::Upstart - else - service_name 'ceph' + action [:enable] + supports :restart => true + end + elsif service_type == 'systemd' + unit = "ceph-mon@#{node['hostname']}.service" + systemd_unit unit do + action :enable end - action [:enable] - supports :restart => true end else Log.info('node["ceph"]["osd_devices"] empty') From 6ff755e501e5773e13cb0ea387455c1e341d95d7 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 14:16:30 -0700 Subject: [PATCH 40/48] copypasta --- metadata.rb | 2 +- recipes/mds.rb | 2 +- recipes/mgr.rb | 2 +- recipes/osd.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.rb b/metadata.rb index 31bd704..ee7ac44 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.30' +version '0.9.31' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mds.rb b/recipes/mds.rb index 0c2a65e..1df4d7e 100644 --- a/recipes/mds.rb +++ b/recipes/mds.rb @@ -64,7 +64,7 @@ action [:enable, :start] supports :restart => true elsif service_type == 'systemd' - unit = "ceph-mon@#{node['hostname']}.service" + unit = "ceph-mds@#{node['hostname']}.service" systemd_unit unit do action :enable end diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 61833ce..9b03675 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -63,7 +63,7 @@ supports :restart => true end elsif service_type == 'systemd' - unit = "ceph-mon@#{node['hostname']}.service" + unit = "ceph-mgr@#{node['hostname']}.service" systemd_unit unit do action :enable end diff --git a/recipes/osd.rb b/recipes/osd.rb index 16a6a04..40ab1cf 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -141,7 +141,7 @@ supports :restart => true end elsif service_type == 'systemd' - unit = "ceph-mon@#{node['hostname']}.service" + unit = "ceph-osd@#{node['hostname']}.service" systemd_unit unit do action :enable end From 83952af4dd925f6d05a1e946e6e66019b1829535 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 14:27:08 -0700 Subject: [PATCH 41/48] fix permissions on mgr key --- metadata.rb | 2 +- recipes/mgr.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index ee7ac44..dd0ce10 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.31' +version '0.9.32' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 9b03675..5098825 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -34,6 +34,8 @@ caps('osd' => 'allow *', 'mon' => 'allow profile mgr', 'mds' => 'allow *') keyname "mgr.#{node['hostname']}" filename "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/keyring" + user node['ceph']['owner'] + group node['ceph']['group'] end file "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/done" do From 57f65f119ce40f8629b9e4a63137145dd865873c Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Thu, 31 Aug 2017 14:31:30 -0700 Subject: [PATCH 42/48] fix the user keyword --- metadata.rb | 2 +- recipes/mgr.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index dd0ce10..f776631 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.32' +version '0.9.33' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mgr.rb b/recipes/mgr.rb index 5098825..5b84374 100644 --- a/recipes/mgr.rb +++ b/recipes/mgr.rb @@ -34,7 +34,7 @@ caps('osd' => 'allow *', 'mon' => 'allow profile mgr', 'mds' => 'allow *') keyname "mgr.#{node['hostname']}" filename "/var/lib/ceph/mgr/#{cluster}-#{node['hostname']}/keyring" - user node['ceph']['owner'] + owner node['ceph']['owner'] group node['ceph']['group'] end From e463fcf9af4f28c935ce3e621f40f5221fba5d88 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 16 Oct 2017 11:04:50 -0700 Subject: [PATCH 43/48] fix mds directory permissions --- metadata.rb | 2 +- recipes/mds.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata.rb b/metadata.rb index f776631..1855d3c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.33' +version '0.9.34' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mds.rb b/recipes/mds.rb index 1df4d7e..ce1b658 100644 --- a/recipes/mds.rb +++ b/recipes/mds.rb @@ -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 From cbaa7ede28e7f0177a4466754c6e5c652c2c9542 Mon Sep 17 00:00:00 2001 From: Jeremy Hanmer Date: Mon, 16 Oct 2017 11:14:47 -0700 Subject: [PATCH 44/48] fix mds keyring permissions --- metadata.rb | 2 +- recipes/mds.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 1855d3c..24c0692 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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.34' +version '0.9.35' depends 'apache2', '>= 1.1.12' depends 'apt' diff --git a/recipes/mds.rb b/recipes/mds.rb index ce1b658..33343a4 100644 --- a/recipes/mds.rb +++ b/recipes/mds.rb @@ -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 From 18852aa97404e3388ba26a32b77378e3dfdeebe8 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Fri, 3 Jan 2020 12:59:07 -0800 Subject: [PATCH 45/48] Add logic to check if mon_host override is defined And don't define it if it is --- templates/default/ceph.conf.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/default/ceph.conf.erb b/templates/default/ceph.conf.erb index c58d879..7c4230c 100644 --- a/templates/default/ceph.conf.erb +++ b/templates/default/ceph.conf.erb @@ -5,7 +5,9 @@ <% if node['ceph']['is_mon'] -%> mon initial members = <%= node['ceph']['config']['mon_initial_members'] %> <% end -%> +<% if !node['ceph']['config']['global']['mon_host'].nil? -%> mon host = <%= @mon_addresses.sort.join(', ') %> +<% end -%> <% if (! node['ceph']['config']['global'].nil?) -%> <% node['ceph']['config']['global'].sort.each do |k, v| %> <%= k %> = <%= v %> From bfadd914b91ff75482d80b1862a91cb95011b1f0 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Fri, 3 Jan 2020 13:00:03 -0800 Subject: [PATCH 46/48] increment version --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 24c0692..04fc640 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.9.35' -depends 'apache2', '>= 1.1.12' +depends 'apache2', '>= 1.1.13' depends 'apt' depends 'yum', '>= 3.0' depends 'yum-epel' From 8dff6ddef36c107a4e37a6011c96fdffa0ae5e58 Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Fri, 3 Jan 2020 13:48:09 -0800 Subject: [PATCH 47/48] Fix logic in mon_host definition mon host won't be defined if ['ceph']['config']['global']['mon host'] or ['ceph']['config']['global']['mon_host'] is --- templates/default/ceph.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/ceph.conf.erb b/templates/default/ceph.conf.erb index 7c4230c..946dda4 100644 --- a/templates/default/ceph.conf.erb +++ b/templates/default/ceph.conf.erb @@ -5,7 +5,7 @@ <% if node['ceph']['is_mon'] -%> mon initial members = <%= node['ceph']['config']['mon_initial_members'] %> <% end -%> -<% if !node['ceph']['config']['global']['mon_host'].nil? -%> +<% if !node['ceph']['config']['global']['mon_host'] && !node['ceph']['config']['global']['mon host'] -%> mon host = <%= @mon_addresses.sort.join(', ') %> <% end -%> <% if (! node['ceph']['config']['global'].nil?) -%> From 91b67ccb46d39931f1a152e97da3bd621567cd2b Mon Sep 17 00:00:00 2001 From: Brian Andrus Date: Fri, 3 Jan 2020 13:50:13 -0800 Subject: [PATCH 48/48] increment version revert mistaken apache version increment too. --- metadata.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index 04fc640..b1e4849 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,9 +4,9 @@ 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.35' +version '0.9.37' -depends 'apache2', '>= 1.1.13' +depends 'apache2', '>= 1.1.12' depends 'apt' depends 'yum', '>= 3.0' depends 'yum-epel'