From f66268162db100e376da9deed59537c20866b805 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 27 Feb 2014 11:01:18 +0100 Subject: [PATCH] Simplify roles a bit We now have an attribute that helps us know when a node is a founder or not. The end goal will be to get rid of the founder role and have the wrapper (for instance, crowbar) set this attribute on one node. This also allows installing pacemaker before corosync, avoiding issues where corosync doesn't know about pacemaker. --- attributes/default.rb | 1 + metadata.rb | 2 ++ recipes/default.rb | 10 +++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 49bcd1e..8e4bff1 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -27,4 +27,5 @@ else return end +default[:pacemaker][:founder] = false default[:pacemaker][:crm][:initial_config_file] = "/etc/corosync/crm-initial.conf" diff --git a/metadata.rb b/metadata.rb index da2e096..ecb5fdd 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,3 +5,5 @@ license "Apache 2.0" description "Installs/configures Pacemaker" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "0.1" + +depends "corosync" diff --git a/recipes/default.rb b/recipes/default.rb index ee85655..003b33e 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -18,4 +18,12 @@ # limitations under the License. # -include_recipe "pacemaker::setup" +if Chef::Config[:solo] + ::Chef::Log.warn "Using Chef Solo, you are expected to manually include the corosync default recipe!" +else + include_recipe "corosync::default" +end + +if node[:pacemaker][:founder] + include_recipe "pacemaker::setup" +end