Removed all ceph logic from this cookbook
The assumptions made in this cookbook for ceph were incorrect. This commit removes all ceph logic from common and shifts the burden of ceph management to the upstream ceph cookbook. Partial-Bug: #1409943 Change-Id: Id9af0f484675992a47401d00afb81886fc4074dc
This commit is contained in:
parent
e7a62853a3
commit
a78ac43af2
@ -13,6 +13,7 @@ This file is used to list changes made in each version of cookbook-openstack-com
|
||||
* Added an optional automatic apt-get update for Debian based repos
|
||||
* Add a new custom matcher render_config_file to test ini file content
|
||||
* Add global rabbit ha flag
|
||||
* Removed all ceph logic
|
||||
|
||||
## 10.1.0
|
||||
* Adding identity admin bind host endpoint to allow flexibility and consistency
|
||||
|
@ -598,33 +598,9 @@ default['openstack']['memcached_servers'] = nil
|
||||
default['openstack']['sysctl']['net.ipv4.conf.all.rp_filter'] = 0
|
||||
default['openstack']['sysctl']['net.ipv4.conf.default.rp_filter'] = 0
|
||||
|
||||
# Default Ceph settings
|
||||
default['openstack']['ceph']['key-url'] = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc'
|
||||
|
||||
# Default OpenStack Network Type: nova (optional: neutron)
|
||||
default['openstack']['compute']['network']['service_type'] = 'nova'
|
||||
|
||||
case platform_family
|
||||
when 'debian'
|
||||
default['openstack']['ceph']['platform']['uri'] = 'http://ceph.com/debian-emperor'
|
||||
when 'fedora', 'rhel', 'suse' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||
default['openstack']['ceph']['platform']['uri'] = 'http://ceph.com/rpm-emperor'
|
||||
end
|
||||
|
||||
# Overriding this makes the ceph_client recipe do nothing
|
||||
# (set this when using the ceph/ceph-cookbooks cookbook).
|
||||
default['openstack']['ceph']['setup_client'] = true
|
||||
|
||||
default['openstack']['ceph']['global'] = {
|
||||
fsid: '00000000-0000-0000-0000-000000000000',
|
||||
mon_initial_members: [],
|
||||
mon_host: [],
|
||||
auth_cluster_required: 'cephx',
|
||||
auth_service_required: 'cephx',
|
||||
auth_client_required: 'cephx',
|
||||
filestore_xattr_use_omap: true
|
||||
}
|
||||
|
||||
case node['platform_family']
|
||||
when 'rhel', 'suse'
|
||||
default['openstack']['common']['platform'] = {
|
||||
|
@ -1,48 +0,0 @@
|
||||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-common
|
||||
# Recipe:: ceph_client
|
||||
#
|
||||
# Copyright 2014, x-ion GmbH
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
return unless node['openstack']['ceph']['setup_client']
|
||||
|
||||
case node['platform_family']
|
||||
when 'debian'
|
||||
apt_repository 'ceph' do
|
||||
uri node['openstack']['ceph']['platform']['uri']
|
||||
distribution node['lsb']['codename']
|
||||
components ['main']
|
||||
key node['openstack']['ceph']['key-url']
|
||||
end
|
||||
when 'fedora', 'rhel', 'suse' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||
# TODO
|
||||
end
|
||||
|
||||
directory '/etc/ceph' do
|
||||
user 'root'
|
||||
group 'root'
|
||||
end
|
||||
|
||||
template '/etc/ceph/ceph.conf' do
|
||||
source 'ceph.conf.erb'
|
||||
user 'root'
|
||||
group 'root'
|
||||
mode '644'
|
||||
variables(
|
||||
global: node['openstack']['ceph']['global']
|
||||
)
|
||||
end
|
@ -1,70 +0,0 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-common::ceph_client' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) do
|
||||
node.set['openstack']['ceph']['global']['fsid'] = '9e5038a9-4329-4cad-8c24-0813a49d1125'
|
||||
node.set['openstack']['ceph']['global']['mon_initial_members'] = %w{ 10.0.1.10 10.0.1.20 }
|
||||
node.set['openstack']['ceph']['global']['mon_hosts'] = %w{ mon01 mon02 }
|
||||
node.set['lsb']['codename'] = 'precise'
|
||||
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
let(:file) { chef_run.template('/etc/ceph/ceph.conf') }
|
||||
|
||||
it 'configures ceph repository' do
|
||||
# Using cookbook(apt) LWRP custom matcher
|
||||
# https://github.com/sethvargo/chefspec#packaging-custom-matchers
|
||||
expect(chef_run).to add_apt_repository('ceph').with(
|
||||
uri: 'http://ceph.com/debian-emperor',
|
||||
components: ['main'],
|
||||
distribution: 'precise')
|
||||
end
|
||||
|
||||
it 'creates the /etc/ceph directory' do
|
||||
expect(chef_run).to create_directory('/etc/ceph').with(
|
||||
owner: 'root',
|
||||
group: 'root'
|
||||
)
|
||||
end
|
||||
|
||||
context 'configuration file' do
|
||||
it 'creates the file' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
owner: 'root',
|
||||
group: 'root',
|
||||
mode: '644'
|
||||
)
|
||||
end
|
||||
|
||||
it 'sets file contents from the global ceph configuration attributes' do
|
||||
node.set['openstack']['ceph']['global'] = {
|
||||
'key_1' => %w(value_1_1 value_1_2),
|
||||
'key_2' => 'value_2'
|
||||
}
|
||||
[/^key_1 = value_1_1, value_1_2$/,
|
||||
/^key_2 = value_2$/].each do |content|
|
||||
expect(chef_run).to render_file(file.name).with_content(content)
|
||||
end
|
||||
end
|
||||
end
|
||||
describe 'when setup_client is not set' do
|
||||
let(:chef_run) do
|
||||
node.set['openstack']['ceph']['setup_client'] = false
|
||||
node.set['lsb']['codename'] = 'precise'
|
||||
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it "doesn't add the repository or create ceph.conf" do
|
||||
expect(chef_run).not_to create_directory('/etc/ceph')
|
||||
expect(chef_run).not_to create_template('/etc/ceph/ceph.conf')
|
||||
expect(chef_run).not_to add_apt_repository('ceph')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,2 +0,0 @@
|
||||
[client.<%= @name -%>]
|
||||
key = <%= @key %>
|
@ -1,8 +0,0 @@
|
||||
[global]
|
||||
<% @global.each do |k,v| -%>
|
||||
<% if v.is_a? Array -%>
|
||||
<%= k %> = <%= v.join ", " %>
|
||||
<% else -%>
|
||||
<%= k %> = <%= v %>
|
||||
<% end -%>
|
||||
<% end -%>
|
Loading…
Reference in New Issue
Block a user