cluster nodes are determined by role assignment, not attributes
This commit is contained in:
@@ -22,9 +22,6 @@ end
|
|||||||
|
|
||||||
default[:pacemaker][:crm][:initial_config_file] = "/etc/corosync/crm-initial.conf"
|
default[:pacemaker][:crm][:initial_config_file] = "/etc/corosync/crm-initial.conf"
|
||||||
|
|
||||||
# Only use short hostname (not FQDN)
|
|
||||||
default['pacemaker']['nodes'] = ['node1', 'node2']
|
|
||||||
|
|
||||||
# Stonith resources should be configured first!
|
# Stonith resources should be configured first!
|
||||||
default['pacemaker']['primitive']['st-node1']['agent'] = "stonith:null"
|
default['pacemaker']['primitive']['st-node1']['agent'] = "stonith:null"
|
||||||
default['pacemaker']['primitive']['st-node1']['params']['hostlist'] = "#{pacemaker['nodes'][0]}"
|
default['pacemaker']['primitive']['st-node1']['params']['hostlist'] = "#{pacemaker['nodes'][0]}"
|
||||||
|
@@ -1,48 +0,0 @@
|
|||||||
# Author:: Robert Choi
|
|
||||||
# Cookbook Name:: pacemaker
|
|
||||||
# Provider:: node
|
|
||||||
#
|
|
||||||
# Copyright:: 2013, Robert Choi
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
require ::File.join(::File.dirname(__FILE__), 'helper')
|
|
||||||
|
|
||||||
action :add do
|
|
||||||
name = new_resource.name
|
|
||||||
|
|
||||||
unless resource_exists?(name)
|
|
||||||
cmd = "crm configure node #{name}"
|
|
||||||
|
|
||||||
cmd_ = Mixlib::ShellOut.new(cmd)
|
|
||||||
cmd_.environment['HOME'] = ENV.fetch('HOME', '/root')
|
|
||||||
cmd_.run_command
|
|
||||||
begin
|
|
||||||
cmd_.error!
|
|
||||||
if resource_exists?(name)
|
|
||||||
new_resource.updated_by_last_action(true)
|
|
||||||
Chef::Log.info "Successfully configured node '#{name}'."
|
|
||||||
else
|
|
||||||
Chef::Log.error "Failed to configure node #{name}."
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
Chef::Log.error "Failed to configure node #{name}."
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
action :delete do
|
|
||||||
#TBU
|
|
||||||
|
|
||||||
end
|
|
@@ -36,12 +36,6 @@ cookbook_file "/usr/lib/ocf/resource.d/openstack/cinder-volume" do
|
|||||||
action :nothing
|
action :nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
node['pacemaker']['nodes'].each do |node|
|
|
||||||
pacemaker_node node do
|
|
||||||
action :add
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Get cinder-volume's myip which might have been set by 'ktc-cinder' cookbook.
|
# Get cinder-volume's myip which might have been set by 'ktc-cinder' cookbook.
|
||||||
if node['pacemaker']['primitive'].include?('vip') and node['cinder'] and node['cinder']['services']['volume']['myip']
|
if node['pacemaker']['primitive'].include?('vip') and node['cinder'] and node['cinder']['services']['volume']['myip']
|
||||||
node.default['pacemaker']['primitive']['vip']['params']['ip'] = node['cinder']['services']['volume']['myip']
|
node.default['pacemaker']['primitive']['vip']['params']['ip'] = node['cinder']['services']['volume']['myip']
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
# Author:: Robert Choi
|
|
||||||
# Cookbook Name:: pacemaker
|
|
||||||
# Resource:: node
|
|
||||||
#
|
|
||||||
# Copyright:: 2013, Robert Choi
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
actions :add, :delete
|
|
||||||
|
|
||||||
default_action :add
|
|
||||||
|
|
||||||
attribute :name, :kind_of => String, :name_attribute => true
|
|
Reference in New Issue
Block a user