diff --git a/attributes/default.rb b/attributes/default.rb index 5e02485..d2ada95 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -22,9 +22,6 @@ end 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! default['pacemaker']['primitive']['st-node1']['agent'] = "stonith:null" default['pacemaker']['primitive']['st-node1']['params']['hostlist'] = "#{pacemaker['nodes'][0]}" diff --git a/providers/node.rb b/providers/node.rb deleted file mode 100644 index c652bef..0000000 --- a/providers/node.rb +++ /dev/null @@ -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 diff --git a/recipes/config.rb b/recipes/config.rb index 6a203aa..957a92d 100644 --- a/recipes/config.rb +++ b/recipes/config.rb @@ -36,12 +36,6 @@ cookbook_file "/usr/lib/ocf/resource.d/openstack/cinder-volume" do action :nothing 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. 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'] diff --git a/resources/node.rb b/resources/node.rb deleted file mode 100644 index 6f2c6b1..0000000 --- a/resources/node.rb +++ /dev/null @@ -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