Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Chef recipe for heartbeat
auth 1
1 md5 <%= @node[:heartbeat][:secret] %>
#
# Cookbook Name:: heartbeat
# Recipe:: default
#
# Copyright 2009, Wikia Inc
#
# 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.
#
package "heartbeat"
template "/etc/ha.d/ha.cf" do
mode 0644
source "ha.cf.erb"
end
template "/etc/ha.d/authkeys" do
mode 0600
source "authkeys.erb"
end
template "/etc/ha.d/haresources" do
mode 0644
source "haresources.erb"
end
service "heartbeat" do
action [ :enable, :start ]
end
logfacility local0
keepalive 250ms
deadtime 2
warntime 1
initdead 15
udpport <%= @node[:heartbeat][:port] %>
ucast <%= @node[:heartbeat][:interface] %> <%= @node[:heartbeat][:other_member] %>
auto_failback off
<% @node[:heartbeat][:nodes].each do |node| -%>
node <%= node %>
<% end -%>
<%= @node[:heartbeat][:haresources] %>
#
# Cookbook Name:: heartbeat
# Attributes:: heartbeat
#
# Copyright 2008, Wikia, Inc.
#
# 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.
#
heartbeat Mash.new unless attribute?("heartbeat")
maintainer "Wikia, Inc."
maintainer_email "ops-l@wikia.com"
license "Apache 2.0"
description "Sets up a heartbeat cluster"
version "0.7"
%w{ ubuntu debian }.each do |os|
supports os
end
attribute "heartbeat",
:display_name => "Heartbeat Hash",
:description => "Hash of heartbeat attributes",
:type => "hash"
attribute "heartbeat/haresources",
:display_name => "Heartbeat resources",
:description => "The resources line for the cluster",
:default => ''
attribute "heartbeat/port",
:display_name => "Heartbeat port",
:description => "The heartbeat port",
:default => "694"
attribute "heartbeat/other_member",
:display_name => "Heartbeat cluster member",
:description => "The other member of the heartbeat cluster",
:default => ''
attribute "heartbeat/interface",
:display_name => "Heartbeat interface",
:description => "Interface that heartbeat listens on",
:default => "eth0"
attribute "heartbeat/nodes",
:display_name => "Heartbeat nodes",
:description => "Members of the heartbeat cluster",
:type => "array"
attribute "heartbeat/secret",
:display_name => "Heartbeat secret",
:description => "Shared cluster password",
:default => "changeme"
"heartbeat": {
"other_member": "192.168.0.5",
"port": "694",
"interface": "eth0",
"haresources": "lvs5 192.168.0.1/24 192.168.0.2/24",
"nodes": [
"node1",
"node2"
],
"secret": "XXXXX"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.