Fixes for lint compliance and working specs.
This fixes agent generator to have the generated files passing lint test. It also adds a rake task. The stonith/ files were generated using it. fence_xvm is documented to be updated manually in the variable.sh file. It will need to be investigated, and if possible refactored to be able to work with the generator for simpler updates. Co-Authored-By: Jason Guiditta <jguiditt@redhat.com> Change-Id: I246eee81de6e8148f4f8c01e6deb42b20775079a
This commit is contained in:
5
Rakefile
5
Rakefile
@@ -18,3 +18,8 @@ PuppetLint::RakeTask.new :lint do |config|
|
||||
config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
|
||||
config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"]
|
||||
end
|
||||
|
||||
desc 'Generate the Stonith modules'
|
||||
task :generate_stonith do
|
||||
sh './agent_generator/generate_manifests.sh'
|
||||
end
|
||||
|
||||
@@ -16,6 +16,8 @@ class FencingMetadataParser
|
||||
@packageName = packageName
|
||||
file = File.new(filename)
|
||||
@doc = REXML::Document.new file
|
||||
@params = []
|
||||
@params_max_len = 14 # pcmk_host_list
|
||||
end
|
||||
|
||||
def getPackageName()
|
||||
@@ -28,22 +30,26 @@ class FencingMetadataParser
|
||||
|
||||
def getParameters()
|
||||
## result have to be array as order should be preserved
|
||||
params = Array.new
|
||||
|
||||
return @params unless @params.empty?
|
||||
@doc.elements.each("resource-agent/parameters/parameter") { |p|
|
||||
param = Hash.new
|
||||
param["name"] = REXML::XPath.match(p, "string(./@name)")[0]
|
||||
@params_max_len = param['name'].length if param['name'].length > @params_max_len
|
||||
param["type"] = REXML::XPath.match(p, "string(./content/@type)")[0]
|
||||
## if 'default' is list then we can not enter it as parameter !!
|
||||
## this is problem only for 'cmd_prompt'
|
||||
param["default"] = REXML::XPath.match(p, "string(./content/@default)")[0]
|
||||
|
||||
param['description'] = REXML::XPath.match(p, 'string(./shortdesc)')[0]
|
||||
## remove parameters that are not usable during automatic execution
|
||||
if not ["help", "version", "action"].include?(param["name"])
|
||||
params.push(param)
|
||||
@params.push(param)
|
||||
end
|
||||
}
|
||||
return params
|
||||
@params
|
||||
end
|
||||
|
||||
def getMaxLen
|
||||
@params_max_len
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,15 +60,60 @@ class ManifestGenerator
|
||||
|
||||
def generate
|
||||
puts <<-eos
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::#{@parser.getAgentName}
|
||||
#
|
||||
# Module for managing Stonith for #{@parser.getAgentName}.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
#{getManifestDocumentation}# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::#{@parser.getAgentName} (
|
||||
#{getManifestParameters}
|
||||
) {
|
||||
#{getVariableValues}
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -71,23 +122,23 @@ define pacemaker::stonith::#{@parser.getAgentName} (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-#{@parser.getAgentName}-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-#{@parser.getAgentName}-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"#{@parser.getPackageName}": ensure => installed,
|
||||
'#{@parser.getPackageName}': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-#{@parser.getAgentName}-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-#{@parser.getAgentName}-${safe_title} #{@parser.getAgentName} pcmk_host_list=\\"${pcmk_host_value_chunk}\\" #{getChunks} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-#{@parser.getAgentName}-${safe_title} #{@parser.getAgentName} pcmk_host_list=\\"${pcmk_host_value_chunk}\\" #{getChunks} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-#{@parser.getAgentName}-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-#{@parser.getAgentName}-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-#{@parser.getAgentName}-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
@@ -95,19 +146,28 @@ define pacemaker::stonith::#{@parser.getAgentName} (
|
||||
eos
|
||||
end
|
||||
|
||||
def getManifestDocumentation
|
||||
text = ''
|
||||
@parser.getParameters.each { |p|
|
||||
text += "# [*#{p['name']}*]\n"
|
||||
text += "# #{p['description']}\n#\n"
|
||||
}
|
||||
text
|
||||
end
|
||||
|
||||
def getManifestParameters
|
||||
text = ""
|
||||
@parser.getParameters.each { |p|
|
||||
text += " $#{p['name']} = undef,\n"
|
||||
text += format_param(p['name'])
|
||||
}
|
||||
|
||||
text += "\n"
|
||||
text += " $interval = \"60s\",\n"
|
||||
text += " $ensure = present,\n"
|
||||
text += " $pcmk_host_list = undef,\n"
|
||||
text += format_param('interval', "'60s'")
|
||||
text += format_param('ensure', 'present')
|
||||
text += format_param('pcmk_host_list')
|
||||
text += "\n"
|
||||
text += " $tries = undef,\n"
|
||||
text += " $try_sleep = undef,"
|
||||
text += format_param('tries')
|
||||
text += format_param('try_sleep')
|
||||
|
||||
return text
|
||||
end
|
||||
@@ -116,7 +176,7 @@ eos
|
||||
text = ""
|
||||
@parser.getParameters.each { |p|
|
||||
text += " $#{p['name']}_chunk = $#{p['name']} ? {\n"
|
||||
text += " undef => \"\",\n"
|
||||
text += " undef => '',\n"
|
||||
text += " default => \"#{p['name']}=\\\"${#{p['name']}}\\\"\",\n"
|
||||
text += " }\n"
|
||||
}
|
||||
@@ -131,6 +191,12 @@ eos
|
||||
}
|
||||
return text
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def format_param(param, value='undef')
|
||||
" $%-#{@parser.getMaxLen}s = %s,\n" % [param, value]
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.length != 3 then
|
||||
|
||||
@@ -1,3 +1,80 @@
|
||||
# == Define: pacemaker::constraint::base
|
||||
#
|
||||
# A generic constraint class. Deprecated. Use defined types that match the
|
||||
# desired constraint instead.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*constraint_type*]
|
||||
# (required) Must be one of: colocation, order, location
|
||||
#
|
||||
# [*constraint_params*]
|
||||
# (optional) Any additional parameters needed by pcs for the constraint to be
|
||||
# properly configured
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*first_resource*]
|
||||
# (optional) First resource to be constrained
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*second_resource*]
|
||||
# (optional) Second resource to be constrained
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*first_action*]
|
||||
# (optional) Only used for order constraints, action to take on first resource
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*second_action*]
|
||||
# (optional) Only used for order constraints, action to take on second resource
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*location*]
|
||||
# (optional) Specific location to place a resource, used only with location
|
||||
# constraint_type
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*score*]
|
||||
# (optional) Numeric score to weight the importance of the constraint
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 10
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::constraint::base (
|
||||
$constraint_type,
|
||||
$constraint_params = undef,
|
||||
@@ -15,21 +92,21 @@ define pacemaker::constraint::base (
|
||||
validate_re($constraint_type, ['colocation', 'order', 'location'])
|
||||
|
||||
if($constraint_type == 'order' and ($first_action == undef or $second_action == undef)) {
|
||||
fail("Must provide actions when constraint type is order")
|
||||
fail('Must provide actions when constraint type is order')
|
||||
}
|
||||
|
||||
if($constraint_type == 'location' and $location == undef) {
|
||||
fail("Must provide location when constraint type is location")
|
||||
fail('Must provide location when constraint type is location')
|
||||
}
|
||||
|
||||
if($constraint_type == 'location' and $score == undef) {
|
||||
fail("Must provide score when constraint type is location")
|
||||
fail('Must provide score when constraint type is location')
|
||||
}
|
||||
|
||||
if $constraint_params != undef {
|
||||
$_constraint_params = "${constraint_params}"
|
||||
$_constraint_params = $constraint_params
|
||||
} else {
|
||||
$_constraint_params = ""
|
||||
$_constraint_params = ''
|
||||
}
|
||||
|
||||
$first_resource_cleaned = regsubst($first_resource, '(:)', '.', 'G')
|
||||
@@ -39,17 +116,17 @@ define pacemaker::constraint::base (
|
||||
if($constraint_type == 'location') {
|
||||
$name_cleaned = regsubst($name, '(:)', '.', 'G')
|
||||
exec { "Removing location constraint ${name}":
|
||||
command => "/usr/sbin/pcs constraint location remove ${name_cleaned}",
|
||||
onlyif => "/usr/sbin/pcs constraint location show --full | grep ${name_cleaned}",
|
||||
require => Exec["wait-for-settle"],
|
||||
command => "/usr/sbin/pcs constraint location remove ${name_cleaned}",
|
||||
onlyif => "/usr/sbin/pcs constraint location show --full | grep ${name_cleaned}",
|
||||
require => Exec['wait-for-settle'],
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
} else {
|
||||
exec { "Removing ${constraint_type} constraint ${name}":
|
||||
command => "/usr/sbin/pcs constraint ${constraint_type} remove ${first_resource_cleaned} ${second_resource_cleaned}",
|
||||
onlyif => "/usr/sbin/pcs constraint ${constraint_type} show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned}",
|
||||
require => Exec["wait-for-settle"],
|
||||
command => "/usr/sbin/pcs constraint ${constraint_type} remove ${first_resource_cleaned} ${second_resource_cleaned}",
|
||||
onlyif => "/usr/sbin/pcs constraint ${constraint_type} show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned}",
|
||||
require => Exec['wait-for-settle'],
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
@@ -57,34 +134,37 @@ define pacemaker::constraint::base (
|
||||
} else {
|
||||
case $constraint_type {
|
||||
'colocation': {
|
||||
fail("Deprecated use pacemaker::constraint::colocation")
|
||||
fail('Deprecated use pacemaker::constraint::colocation')
|
||||
exec { "Creating colocation constraint ${name}":
|
||||
command => "/usr/sbin/pcs constraint colocation add ${first_resource_cleaned} ${second_resource_cleaned} ${score}",
|
||||
unless => "/usr/sbin/pcs constraint colocation show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec["wait-for-settle"],Package["pcs"]],
|
||||
command => "/usr/sbin/pcs constraint colocation add ${first_resource_cleaned} ${second_resource_cleaned} ${score}",
|
||||
unless => "/usr/sbin/pcs constraint colocation show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec['wait-for-settle'],Package['pcs']],
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
'order': {
|
||||
exec { "Creating order constraint ${name}":
|
||||
command => "/usr/sbin/pcs constraint order ${first_action} ${first_resource_cleaned} then ${second_action} ${second_resource_cleaned} ${_constraint_params}",
|
||||
unless => "/usr/sbin/pcs constraint order show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec["wait-for-settle"],Package["pcs"]],
|
||||
command => "/usr/sbin/pcs constraint order ${first_action} ${first_resource_cleaned} then ${second_action} ${second_resource_cleaned} ${_constraint_params}",
|
||||
unless => "/usr/sbin/pcs constraint order show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec['wait-for-settle'],Package['pcs']],
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
'location': {
|
||||
fail("Deprecated use pacemaker::constraint::location")
|
||||
fail('Deprecated use pacemaker::constraint::location')
|
||||
exec { "Creating location constraint ${name}":
|
||||
command => "/usr/sbin/pcs constraint location add ${name} ${first_resource_cleaned} ${location} ${score}",
|
||||
unless => "/usr/sbin/pcs constraint location show | grep ${first_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec["wait-for-settle"],Package["pcs"]],
|
||||
command => "/usr/sbin/pcs constraint location add ${name} ${first_resource_cleaned} ${location} ${score}",
|
||||
unless => "/usr/sbin/pcs constraint location show | grep ${first_resource_cleaned} > /dev/null 2>&1",
|
||||
require => [Exec['wait-for-settle'],Package['pcs']],
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail('A constraint_type mst be provided')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,66 @@
|
||||
define pacemaker::constraint::colocation ($source,
|
||||
$target,
|
||||
$score,
|
||||
$master_slave=false,
|
||||
$ensure=present) {
|
||||
pcmk_constraint {"colo-$source-$target":
|
||||
constraint_type => colocation,
|
||||
resource => $source,
|
||||
location => $target,
|
||||
score => $score,
|
||||
master_slave => $master_slave,
|
||||
ensure => $ensure,
|
||||
require => Exec["wait-for-settle"],
|
||||
}
|
||||
# == Define: pacemaker::constraint::colocation
|
||||
#
|
||||
# Creates Colocation constraints for resources that need to reside together.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*source*]
|
||||
# (required) First resource to be grouped together
|
||||
#
|
||||
# [*target*]
|
||||
# (required) Second (target) resource to be grouped together
|
||||
#
|
||||
# [*score*]
|
||||
# (required) Numberic weighting of priority of colocation
|
||||
#
|
||||
# [*master_slave*]
|
||||
# (optional) Whether to set a resource with one node as master
|
||||
# Defaults to false
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::constraint::colocation (
|
||||
$source,
|
||||
$target,
|
||||
$score,
|
||||
$master_slave = false,
|
||||
$ensure = present,
|
||||
) {
|
||||
pcmk_constraint {"colo-${source}-${target}":
|
||||
ensure => $ensure,
|
||||
constraint_type => colocation,
|
||||
resource => $source,
|
||||
location => $target,
|
||||
score => $score,
|
||||
master_slave => $master_slave,
|
||||
require => Exec['wait-for-settle'],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,60 @@
|
||||
define pacemaker::constraint::location ($resource,
|
||||
$location,
|
||||
$score,
|
||||
$ensure='present') {
|
||||
pcmk_constraint {"loc-$resource-$location":
|
||||
constraint_type => location,
|
||||
resource => $resource,
|
||||
location => $location,
|
||||
score => $score,
|
||||
ensure => $ensure,
|
||||
require => Exec["wait-for-settle"],
|
||||
}
|
||||
# == Define: pacemaker::constraint::location
|
||||
#
|
||||
# Manages constraint on location of a resource
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*resource*]
|
||||
# (required) The name of the resource to be constrained
|
||||
#
|
||||
# [*location*]
|
||||
# (required) Specific location to place a resource
|
||||
#
|
||||
# [*score*]
|
||||
# (required) Numeric score to weight the importance of the constraint
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::constraint::location (
|
||||
$resource,
|
||||
$location,
|
||||
$score,
|
||||
$ensure='present'
|
||||
) {
|
||||
pcmk_constraint {"loc-${resource}-${location}":
|
||||
ensure => $ensure,
|
||||
constraint_type => location,
|
||||
resource => $resource,
|
||||
location => $location,
|
||||
score => $score,
|
||||
require => Exec['wait-for-settle'],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,41 +3,85 @@
|
||||
# A class to setup a pacemaker cluster
|
||||
#
|
||||
# === Parameters
|
||||
# [*cluster_name*]
|
||||
# The name of the cluster (no whitespace)
|
||||
# [*cluster_members*]
|
||||
# A space-separted list of cluster IP's or names to run the authentication against
|
||||
# (required) A space-separted list of cluster IP's or names to run the
|
||||
# authentication against
|
||||
#
|
||||
# [*cluster_members_rrp*]
|
||||
# A space-separated list of cluster IP's or names pair where each component represent a resource on respectively ring0 and ring1
|
||||
# [*setup_cluster*]
|
||||
# If your cluster includes pcsd, this should be set to true for just
|
||||
# one node in cluster. Else set to true for all nodes.
|
||||
# [*manage_fw*]
|
||||
# Manage or not IPtables rules.
|
||||
# [*settle_timeout*]
|
||||
# Timeout to wait for settle.
|
||||
# [*settle_tries*]
|
||||
# Number of tries for settle.
|
||||
# [*settle_try_sleep*]
|
||||
# Time to sleep after each seetle try.
|
||||
# [*remote_authkey*]
|
||||
# Value of /etc/pacemaker/authkey. Useful for pacemaker_remote.
|
||||
# (optional) A space-separated list of cluster IP's or names pair where each
|
||||
# component represent a resource on respectively ring0 and ring1
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*cluster_name*]
|
||||
# (optional) The name of the cluster (no whitespace)
|
||||
# Defaults to 'clustername'
|
||||
#
|
||||
# [*cluster_setup_extras*]
|
||||
# Hash additional configuration when pcs cluster setup is run
|
||||
# (optional) Hash additional configuration when pcs cluster setup is run
|
||||
# Example : {'--token' => '10000', '--ipv6' => '', '--join' => '100' }
|
||||
|
||||
|
||||
# Defaults to {}
|
||||
#
|
||||
# [*manage_fw*]
|
||||
# (optional) Manage or not IPtables rules.
|
||||
# Defaults to true
|
||||
#
|
||||
# [*remote_authkey*]
|
||||
# (optional) Value of /etc/pacemaker/authkey. Useful for pacemaker_remote.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*settle_timeout*]
|
||||
# (optional) Timeout to wait for settle.
|
||||
# Defaults to 3600
|
||||
#
|
||||
# [*settle_tries*]
|
||||
# (optional) Number of tries for settle.
|
||||
# Defaults to 360
|
||||
#
|
||||
# [*settle_try_sleep*]
|
||||
# (optional) Time to sleep after each seetle try.
|
||||
# Defaults to 10
|
||||
#
|
||||
# [*setup_cluster*]
|
||||
# (optional) If your cluster includes pcsd, this should be set to true for
|
||||
# just one node in cluster. Else set to true for all nodes.
|
||||
# Defaults to true
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::corosync(
|
||||
$cluster_members,
|
||||
$cluster_members_rrp = undef,
|
||||
$cluster_name = 'clustername',
|
||||
$setup_cluster = true,
|
||||
$cluster_setup_extras = {},
|
||||
$manage_fw = true,
|
||||
$remote_authkey = undef,
|
||||
$settle_timeout = '3600',
|
||||
$settle_tries = '360',
|
||||
$settle_try_sleep = '10',
|
||||
$remote_authkey = undef,
|
||||
$cluster_setup_extras = {},
|
||||
$setup_cluster = true,
|
||||
) inherits pacemaker {
|
||||
include ::pacemaker::params
|
||||
|
||||
@@ -55,7 +99,7 @@ class pacemaker::corosync(
|
||||
}
|
||||
}
|
||||
|
||||
if $pcsd_mode {
|
||||
if $pacemaker::pcsd_mode {
|
||||
if $manage_fw {
|
||||
firewall { '001 pcsd':
|
||||
proto => 'tcp',
|
||||
@@ -71,24 +115,24 @@ class pacemaker::corosync(
|
||||
}
|
||||
Service['pcsd'] ->
|
||||
# we have more fragile when-to-start pacemaker conditions with pcsd
|
||||
exec {"enable-not-start-$cluster_name":
|
||||
command => "/usr/sbin/pcs cluster enable"
|
||||
exec {"enable-not-start-${cluster_name}":
|
||||
command => '/usr/sbin/pcs cluster enable'
|
||||
}
|
||||
->
|
||||
exec {"Set password for hacluster user on $cluster_name":
|
||||
exec {"Set password for hacluster user on ${cluster_name}":
|
||||
command => "/bin/echo ${::pacemaker::hacluster_pwd} | /usr/bin/passwd --stdin hacluster",
|
||||
creates => "/etc/cluster/cluster.conf",
|
||||
require => Class["::pacemaker::install"],
|
||||
creates => '/etc/cluster/cluster.conf',
|
||||
require => Class['::pacemaker::install'],
|
||||
}
|
||||
->
|
||||
exec {"auth-successful-across-all-nodes":
|
||||
command => "/usr/sbin/pcs cluster auth $cluster_members -u hacluster -p ${::pacemaker::hacluster_pwd} --force",
|
||||
exec {'auth-successful-across-all-nodes':
|
||||
command => "/usr/sbin/pcs cluster auth ${cluster_members} -u hacluster -p ${::pacemaker::hacluster_pwd} --force",
|
||||
timeout => $settle_timeout,
|
||||
tries => $settle_tries,
|
||||
try_sleep => $settle_try_sleep,
|
||||
}
|
||||
->
|
||||
Exec["wait-for-settle"]
|
||||
Exec['wait-for-settle']
|
||||
}
|
||||
|
||||
if $setup_cluster {
|
||||
@@ -101,33 +145,33 @@ class pacemaker::corosync(
|
||||
|
||||
$cluster_setup_extras_real = inline_template('<%= @cluster_setup_extras.flatten.join(" ") %>')
|
||||
|
||||
exec {"Create Cluster $cluster_name":
|
||||
creates => "/etc/cluster/cluster.conf",
|
||||
command => "/usr/sbin/pcs cluster setup --name $cluster_name $cluster_members_rrp_real $cluster_setup_extras_real",
|
||||
unless => "/usr/bin/test -f /etc/corosync/corosync.conf",
|
||||
require => Class["::pacemaker::install"],
|
||||
exec {"Create Cluster ${cluster_name}":
|
||||
creates => '/etc/cluster/cluster.conf',
|
||||
command => "/usr/sbin/pcs cluster setup --name ${cluster_name} ${cluster_members_rrp_real} ${cluster_setup_extras_real}",
|
||||
unless => '/usr/bin/test -f /etc/corosync/corosync.conf',
|
||||
require => Class['::pacemaker::install'],
|
||||
}
|
||||
->
|
||||
exec {"Start Cluster $cluster_name":
|
||||
unless => "/usr/sbin/pcs status >/dev/null 2>&1",
|
||||
command => "/usr/sbin/pcs cluster start --all",
|
||||
require => Exec["Create Cluster $cluster_name"],
|
||||
exec {"Start Cluster ${cluster_name}":
|
||||
unless => '/usr/sbin/pcs status >/dev/null 2>&1',
|
||||
command => '/usr/sbin/pcs cluster start --all',
|
||||
require => Exec["Create Cluster ${cluster_name}"],
|
||||
}
|
||||
if $pcsd_mode {
|
||||
Exec["auth-successful-across-all-nodes"] ->
|
||||
Exec["Create Cluster $cluster_name"]
|
||||
if $pacemaker::pcsd_mode {
|
||||
Exec['auth-successful-across-all-nodes'] ->
|
||||
Exec["Create Cluster ${cluster_name}"]
|
||||
}
|
||||
Exec["Start Cluster $cluster_name"] ->
|
||||
Exec["wait-for-settle"]
|
||||
Exec["Start Cluster ${cluster_name}"] ->
|
||||
Exec['wait-for-settle']
|
||||
}
|
||||
|
||||
if $remote_authkey {
|
||||
file { 'etc-pacemaker':
|
||||
ensure => directory,
|
||||
path => '/etc/pacemaker',
|
||||
owner => 'hacluster',
|
||||
group => 'haclient',
|
||||
mode => '0750',
|
||||
path => '/etc/pacemaker',
|
||||
owner => 'hacluster',
|
||||
group => 'haclient',
|
||||
mode => '0750',
|
||||
} ->
|
||||
file { 'etc-pacemaker-authkey':
|
||||
path => '/etc/pacemaker/authkey',
|
||||
@@ -137,23 +181,23 @@ class pacemaker::corosync(
|
||||
content => $remote_authkey,
|
||||
}
|
||||
if $setup_cluster {
|
||||
File['etc-pacemaker-authkey'] -> Exec["Create Cluster $cluster_name"]
|
||||
File['etc-pacemaker-authkey'] -> Exec["Create Cluster ${cluster_name}"]
|
||||
}
|
||||
if $pcsd_mode {
|
||||
if $pacemaker::pcsd_mode {
|
||||
File['etc-pacemaker-authkey'] -> Service['pcsd']
|
||||
}
|
||||
}
|
||||
|
||||
exec {"wait-for-settle":
|
||||
exec {'wait-for-settle':
|
||||
timeout => $settle_timeout,
|
||||
tries => $settle_tries,
|
||||
try_sleep => $settle_try_sleep,
|
||||
command => "/usr/sbin/pcs status | grep -q 'partition with quorum' > /dev/null 2>&1",
|
||||
unless => "/usr/sbin/pcs status | grep -q 'partition with quorum' > /dev/null 2>&1",
|
||||
notify => Notify["pacemaker settled"],
|
||||
notify => Notify['pacemaker settled'],
|
||||
}
|
||||
|
||||
notify {"pacemaker settled":
|
||||
message => "Pacemaker has reported quorum achieved",
|
||||
notify {'pacemaker settled':
|
||||
message => 'Pacemaker has reported quorum achieved',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,22 +16,39 @@
|
||||
# communicate between nodes.
|
||||
# Default: $pacemaker::params::hacluster_pwd
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Examples
|
||||
#
|
||||
# see pacemaker::corosync
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Dan Radez <dradez@redhat.com>
|
||||
# Dan Radez <dradez@redhat.com>
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright 2013 Red Hat Inc.
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
|
||||
class pacemaker(
|
||||
$hacluster_pwd = $pacemaker::params::hacluster_pwd
|
||||
) inherits pacemaker::params {
|
||||
$hacluster_pwd = $pacemaker::params::hacluster_pwd
|
||||
) inherits ::pacemaker::params {
|
||||
include ::pacemaker::params
|
||||
include ::pacemaker::install
|
||||
include ::pacemaker::service
|
||||
|
||||
@@ -1,8 +1,43 @@
|
||||
# == Class: pacemaker::install
|
||||
#
|
||||
# Installs needed packages for pacemaker
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure packages are present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::install (
|
||||
$ensure = present,
|
||||
) {
|
||||
include pacemaker::params
|
||||
package { $pacemaker::params::package_list:
|
||||
include ::pacemaker::params
|
||||
package { $::pacemaker::params::package_list:
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,44 @@
|
||||
# == Class: pacemaker::params
|
||||
#
|
||||
# Variables used by classes in the module
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::params {
|
||||
|
||||
$hacluster_pwd = 'CHANGEME'
|
||||
case $::osfamily {
|
||||
redhat: {
|
||||
'redhat': {
|
||||
if $::operatingsystemrelease =~ /^6\..*$/ {
|
||||
$package_list = ["pacemaker","pcs","fence-agents","cman"]
|
||||
$package_list = ['pacemaker','pcs','fence-agents','cman']
|
||||
# TODO in el6.6, $pcsd_mode should be true
|
||||
$pcsd_mode = false
|
||||
$services_manager = 'lsb'
|
||||
} else {
|
||||
$package_list = ["pacemaker","pcs","fence-agents-all","pacemaker-libs"]
|
||||
$package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs']
|
||||
$pcsd_mode = true
|
||||
$services_manager = 'systemd'
|
||||
}
|
||||
|
||||
@@ -1,3 +1,60 @@
|
||||
# == Define: pacemaker::property
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*property*]
|
||||
# (required) Name of the property to set or remove
|
||||
#
|
||||
# [*value*]
|
||||
# (optional) Value to set the property to, required if ensure is set to
|
||||
# present
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*node*]
|
||||
# (optional) Specific node to set the property on
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*force*]
|
||||
# (optional) Whether to force creation of the property
|
||||
# Defaults to false
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 10
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::property (
|
||||
$property,
|
||||
$value = undef,
|
||||
|
||||
@@ -1,37 +1,92 @@
|
||||
# == Define Resource Type: pacemaker::resource::filesystem
|
||||
# == Define: pacemaker::resource::filesystem
|
||||
#
|
||||
# A resource type to create pacemaker Filesystem resources, provided
|
||||
# for convenience.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*name*]
|
||||
# The name of the pacemaker resource, i.e. as seen in "pcs status".
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make the resource present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*device*]
|
||||
# The device which is being mounted. E.g. 192.168.200.100:/export/foo.
|
||||
# (optional) The device which is being mounted
|
||||
# For example: 192.168.200.100:/export/foo
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*directory*]
|
||||
# Where to mount the device (the empty dir must already exist).
|
||||
# (optional) Where to mount the device (the empty dir must already exist)
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*fsoptions*]
|
||||
# (optional) Filesystem options as you would pass to mount command
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*fstype*]
|
||||
# As you would pass to mount. E.g., nfs.
|
||||
# (optional) As you would pass to mount, for example 'nfs'
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*meta_params*]
|
||||
# Additional meta parameters to pass to "pcs create". Optional.
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*op_params*]
|
||||
# Additional op parameters to pass to "pcs create". Optional.
|
||||
# (optional) Additional op parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# Additional clone parameters to pass to "pcs create". Use '' or true
|
||||
# for to pass --clone to "pcs resource create" with no addtional clone
|
||||
# parameters. Optional.
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# Additional group parameters to pass to "pcs create", typically just
|
||||
# the the name of the pacemaker resource group. Optional.
|
||||
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long in seconds to wait for the next action after successful
|
||||
# action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create or remove the resource
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::filesystem(
|
||||
$ensure = 'present',
|
||||
$device = '',
|
||||
|
||||
@@ -1,27 +1,73 @@
|
||||
# == Define Resource Type: pacemaker::resource::ip
|
||||
# == Define: pacemaker::resource::ip
|
||||
#
|
||||
# A resource type to create pacemaker IPaddr2 resources, provided
|
||||
# for convenience.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*name*]
|
||||
# The name of the pacemaker resource, i.e. as seen in "pcs status".
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure resource is created or removed
|
||||
# Defaults to present
|
||||
#
|
||||
# [*ip_address*]
|
||||
# The virtual IP address you want pacemaker to create and manage.
|
||||
# (optional) The virtual IP address you want pacemaker to create and manage
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*cidr_netmask*]
|
||||
# The netmask to use in the cidr= option in the "pcs resource create"
|
||||
# command. Optional. Default is '32'.
|
||||
# (optional) The netmask to use in the cidr= option in the
|
||||
# "pcs resource create"command
|
||||
# Defaults to '32'
|
||||
#
|
||||
# [*nic*]
|
||||
# The nic to use in the nic= option in the "pcs resource create"
|
||||
# command. Optional.
|
||||
# (optional) The nic to use in the nic= option in the "pcs resource create"
|
||||
# command
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*group_params*]
|
||||
# Additional group parameters to pass to "pcs create", typically just
|
||||
# the the name of the pacemaker resource group. Optional.
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to perform the action
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::ip(
|
||||
$ensure = 'present',
|
||||
|
||||
@@ -1,8 +1,83 @@
|
||||
# == Define Resource Type: pacemaker::resource::lsb
|
||||
# == Define: pacemaker::resource::lsb
|
||||
#
|
||||
# See pacemaker::resource::service. Typical usage is to declare
|
||||
# pacemaker::resource::service rather than this resource directly.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service to manage
|
||||
# Defaults to name used to create the resource
|
||||
#
|
||||
# [*resource_params*]
|
||||
# (optional) Any additional parameters needed by pcs for the resource to be
|
||||
# properly configured
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*meta_params*]
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*op_params*]
|
||||
# (optional) Additional op parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::lsb(
|
||||
$ensure = 'present',
|
||||
$service_name = $name,
|
||||
|
||||
@@ -1,36 +1,86 @@
|
||||
# == Define Resource Type: pacemaker::resource::ocf
|
||||
# == Define: pacemaker::resource::ocf
|
||||
#
|
||||
# A resource type to create pacemaker ocf resources, provided for
|
||||
# convenience.
|
||||
#
|
||||
# === Parameters
|
||||
# === Parameters:
|
||||
#
|
||||
# [*name*]
|
||||
# The name of the pacemaker resource, i.e. as seen in "pcs status".
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*ocf_agent_name*]
|
||||
# The name of the ocf resource agent. Optional. Defaults to *name*.
|
||||
# (optional) The name of the ocf resource agent
|
||||
# Defaults to *name*
|
||||
#
|
||||
# [*resource_params*]
|
||||
# Additional resource parameters to pass to "pcs create". Optional.
|
||||
#
|
||||
# [*op_params*]
|
||||
# Additional op parameters to pass to "pcs create". Optional.
|
||||
# (optional) Any additional parameters needed by pcs for the resource to be
|
||||
# properly configured
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*meta_params*]
|
||||
# Additional meta parameters to pass to "pcs create". Optional.
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*master_params*]
|
||||
# Additional meta parameters to pass to "pcs create". Optional.
|
||||
# [*op_params*]
|
||||
# (optional) Additional op parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# Additional clone parameters to pass to "pcs create". Use '' or true
|
||||
# for to pass --clone to "pcs resource create" with no addtional clone
|
||||
# parameters. Optional.
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# Additional group parameters to pass to "pcs create", typically just
|
||||
# the the name of the pacemaker resource group. Optional.
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*master_params*]
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::ocf(
|
||||
$ensure = 'present',
|
||||
|
||||
@@ -1,3 +1,82 @@
|
||||
# == Define: pacemaker::resource::lsb
|
||||
#
|
||||
# See pacemaker::resource::service. Typical usage is to declare
|
||||
# pacemaker::resource::service rather than this resource directly.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*src*]
|
||||
# (optional) Route source
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*dest*]
|
||||
# (optional) Route destination
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*gateway*]
|
||||
# (optional) Gateway to use
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*nic*]
|
||||
# (optional) Network interface to use
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::route(
|
||||
$ensure = 'present',
|
||||
$src = '',
|
||||
@@ -32,7 +111,7 @@ define pacemaker::resource::route(
|
||||
default => " gateway=${gateway}"
|
||||
}
|
||||
|
||||
pcmk_resource { "route-${name}-${group}":
|
||||
pcmk_resource { "route-${name}":
|
||||
ensure => $ensure,
|
||||
resource_type => 'Route',
|
||||
resource_params => "${dest_option} ${src_option} ${nic_option} ${gw_option}",
|
||||
|
||||
@@ -1,33 +1,82 @@
|
||||
# == Define Resource Type: pacemaker::resource::service
|
||||
# == Define: pacemaker::resource::service
|
||||
#
|
||||
# A resource type to create pacemaker lsb or systemd resources
|
||||
# (depending on distro), provided for convenience.
|
||||
#
|
||||
# === Parameters
|
||||
# === Parameters:
|
||||
#
|
||||
# [*name*]
|
||||
# The name of the pacemaker resource, i.e. as seen in "pcs status".
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*service_name*]
|
||||
# The name of the systemd or lsb service. Optional. Defaults to *name*.
|
||||
# (optional) Name of the service to manage
|
||||
# Defaults to name used to create the resource
|
||||
#
|
||||
# [*resource_params*]
|
||||
# Additional resource parameters to pass to "pcs create". Optional.
|
||||
#
|
||||
# [*op_params*]
|
||||
# Additional op parameters to pass to "pcs create". Optional.
|
||||
# (optional) Any additional parameters needed by pcs for the resource to be
|
||||
# properly configured
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*meta_params*]
|
||||
# Additional meta parameters to pass to "pcs create". Optional.
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*op_params*]
|
||||
# (optional) Additional op parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# Additional clone parameters to pass to "pcs create". Use '' or true
|
||||
# for to pass --clone to "pcs resource create" with no addtional clone
|
||||
# parameters. Optional.
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# Additional group parameters to pass to "pcs create", typically just
|
||||
# the the name of the pacemaker resource group. Optional.
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::service(
|
||||
$ensure = 'present',
|
||||
|
||||
@@ -1,8 +1,83 @@
|
||||
# == Define Resource Type: pacemaker::resource::systemd
|
||||
# == Define: pacemaker::resource::systemd
|
||||
#
|
||||
# See pacemaker::resource::service. Typical usage is to declare
|
||||
# pacemaker::resource::service rather than this resource directly.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure the constraint is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service to manage
|
||||
# Defaults to name used to create the resource
|
||||
#
|
||||
# [*resource_params*]
|
||||
# (optional) Any additional parameters needed by pcs for the resource to be
|
||||
# properly configured
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*meta_params*]
|
||||
# (optional) Additional meta parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*op_params*]
|
||||
# (optional) Additional op parameters to pass to "pcs create"
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*clone_params*]
|
||||
# (optional) Additional clone parameters to pass to "pcs create". Use ''
|
||||
# or true for to pass --clone to "pcs resource create" with no addtional
|
||||
# clone parameters
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*group_params*]
|
||||
# (optional) Additional group parameters to pass to "pcs create", typically
|
||||
# just the name of the pacemaker resource group
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*post_success_sleep*]
|
||||
# (optional) How long to wait acfter successful action
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt to create the constraint
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries, in seconds
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*verify_on_create*]
|
||||
# (optional) Whether to verify creation of resource
|
||||
# Defaults to false
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::resource::systemd(
|
||||
$ensure = 'present',
|
||||
$service_name = $name,
|
||||
|
||||
@@ -1,9 +1,47 @@
|
||||
# == Class: pacemaker::resource_defaults
|
||||
#
|
||||
# Defaults to set for pcs resources
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*defaults*]
|
||||
# (required) Comma separated string of key=value pairs specifying defaults.
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to create or remove the defaults
|
||||
# Defaults to present
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::resource_defaults(
|
||||
$defaults,
|
||||
$ensure = 'present',
|
||||
) {
|
||||
create_resources(
|
||||
"pcmk_resource_default",
|
||||
'pcmk_resource_default',
|
||||
$defaults,
|
||||
{
|
||||
ensure => $ensure,
|
||||
|
||||
@@ -1,3 +1,50 @@
|
||||
# == Class: pacemaker::service
|
||||
#
|
||||
# Configure the pacemaker system service settings
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Make sure the service is running or stopped
|
||||
# Defaults to running
|
||||
#
|
||||
# [*hasstatus*]
|
||||
# (optional) Whether the service reports its status
|
||||
# Defaults to true
|
||||
#
|
||||
# [*hasrestart*]
|
||||
# (optional) Whether the service can be restarted
|
||||
# Defaults to true
|
||||
#
|
||||
# [*enable*]
|
||||
# (optional) Whether to enable the service on boot
|
||||
# Defaults to true
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::service (
|
||||
$ensure = running,
|
||||
$hasstatus = true,
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
# == Class: pacemaker::stonith
|
||||
#
|
||||
# Configures the pacemaker property that set whether stonith is enabled or not.
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*disable*]
|
||||
# (optional) Whether to disable stonith
|
||||
# Defaults to true
|
||||
#
|
||||
# === Dependencies
|
||||
#
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
class pacemaker::stonith ($disable=true) {
|
||||
if $disable == true {
|
||||
pacemaker::property { 'Disable STONITH':
|
||||
|
||||
@@ -1,128 +1,240 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_apc
|
||||
#
|
||||
# Module for managing Stonith for fence_apc.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*switch*]
|
||||
# Physical switch number on device
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_apc (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$switch = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$switch = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$switch_chunk = $switch ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "switch=\"${switch}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -131,23 +243,23 @@ define pacemaker::stonith::fence_apc (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_apc-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_apc-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-apc": ensure => installed,
|
||||
'fence-agents-apc': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_apc-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_apc-${safe_title} fence_apc pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${switch_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_apc-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_apc-${safe_title} fence_apc pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${switch_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_apc-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_apc-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_apc-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_apc-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_apc_snmp
|
||||
#
|
||||
# Module for managing Stonith for fence_apc_snmp.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_apc_snmp (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_apc_snmp (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_apc_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_apc_snmp-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-apc-snmp": ensure => installed,
|
||||
'fence-agents-apc-snmp': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_apc_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_apc_snmp-${safe_title} fence_apc_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_apc_snmp-${safe_title} fence_apc_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_apc_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_apc_snmp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_apc_snmp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,128 +1,240 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_bladecenter
|
||||
#
|
||||
# Module for managing Stonith for fence_bladecenter.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*missing_as_off*]
|
||||
# Missing port returns OFF instead of failure
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_bladecenter (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$missing_as_off = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$missing_as_off_chunk = $missing_as_off ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "missing_as_off=\"${missing_as_off}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -131,23 +243,23 @@ define pacemaker::stonith::fence_bladecenter (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_bladecenter-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_bladecenter-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-bladecenter": ensure => installed,
|
||||
'fence-agents-bladecenter': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_bladecenter-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_bladecenter-${safe_title} fence_bladecenter pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_bladecenter-${safe_title} fence_bladecenter pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_bladecenter-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_bladecenter-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_bladecenter-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,232 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_brocade
|
||||
#
|
||||
# Module for managing Stonith for fence_brocade.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_brocade (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -126,23 +235,23 @@ define pacemaker::stonith::fence_brocade (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_brocade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_brocade-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_brocade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_brocade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-brocade": ensure => installed,
|
||||
'fence-agents-brocade': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_brocade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_brocade-${safe_title} fence_brocade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_brocade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_brocade-${safe_title} fence_brocade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_brocade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_brocade-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_brocade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_brocade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_cisco_mds
|
||||
#
|
||||
# Module for managing Stonith for fence_cisco_mds.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_cisco_mds (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_cisco_mds (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_cisco_mds-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_cisco_mds-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-cisco-mds": ensure => installed,
|
||||
'fence-agents-cisco-mds': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_cisco_mds-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_cisco_mds-${safe_title} fence_cisco_mds pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_cisco_mds-${safe_title} fence_cisco_mds pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_cisco_mds-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_cisco_mds-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_cisco_mds-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,128 +1,240 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_cisco_ucs
|
||||
#
|
||||
# Module for managing Stonith for fence_cisco_ucs.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*ssl*]
|
||||
# SSL connection
|
||||
#
|
||||
# [*notls*]
|
||||
# Disable TLS negotiation
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*suborg*]
|
||||
# Additional path needed to access suborganization
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*ssl_secure*]
|
||||
# SSL connection with verifying fence device's certificate
|
||||
#
|
||||
# [*ssl_insecure*]
|
||||
# SSL connection without verifying fence device's certificate
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_cisco_ucs (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$suborg = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$suborg = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$ssl_chunk = $ssl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl=\"${ssl}\"",
|
||||
}
|
||||
$notls_chunk = $notls ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "notls=\"${notls}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$suborg_chunk = $suborg ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "suborg=\"${suborg}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$ssl_secure_chunk = $ssl_secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_secure=\"${ssl_secure}\"",
|
||||
}
|
||||
$ssl_insecure_chunk = $ssl_insecure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_insecure=\"${ssl_insecure}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -131,23 +243,23 @@ define pacemaker::stonith::fence_cisco_ucs (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_cisco_ucs-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_cisco_ucs-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-cisco-ucs": ensure => installed,
|
||||
'fence-agents-cisco-ucs': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_cisco_ucs-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_cisco_ucs-${safe_title} fence_cisco_ucs pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${suborg_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_cisco_ucs-${safe_title} fence_cisco_ucs pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${suborg_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_cisco_ucs-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_cisco_ucs-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_cisco_ucs-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,128 +1,240 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_drac5
|
||||
#
|
||||
# Module for managing Stonith for fence_drac5.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*drac_version*]
|
||||
# Force DRAC version to use
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_drac5 (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$drac_version = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$drac_version = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$drac_version_chunk = $drac_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "drac_version=\"${drac_version}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -131,23 +243,23 @@ define pacemaker::stonith::fence_drac5 (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_drac5-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_drac5-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_drac5-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_drac5-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-drac5": ensure => installed,
|
||||
'fence-agents-drac5': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_drac5-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_drac5-${safe_title} fence_drac5 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${drac_version_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_drac5-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_drac5-${safe_title} fence_drac5 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${drac_version_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_drac5-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_drac5-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_drac5-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_drac5-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_eaton_snmp
|
||||
#
|
||||
# Module for managing Stonith for fence_eaton_snmp.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_eaton_snmp (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_eaton_snmp (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_eaton_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_eaton_snmp-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-eaton-snmp": ensure => installed,
|
||||
'fence-agents-eaton-snmp': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_eaton_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_eaton_snmp-${safe_title} fence_eaton_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_eaton_snmp-${safe_title} fence_eaton_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_eaton_snmp-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_eaton_snmp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_eaton_snmp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +1,208 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_eps
|
||||
#
|
||||
# Module for managing Stonith for fence_eps.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*hidden_page*]
|
||||
# Name of hidden page
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_eps (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$hidden_page = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$hidden_page = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$hidden_page_chunk = $hidden_page ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "hidden_page=\"${hidden_page}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -111,23 +211,23 @@ define pacemaker::stonith::fence_eps (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_eps-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_eps-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_eps-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_eps-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-eps": ensure => installed,
|
||||
'fence-agents-eps': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_eps-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_eps-${safe_title} fence_eps pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${hidden_page_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_eps-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_eps-${safe_title} fence_eps pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${hidden_page_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_eps-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_eps-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_eps-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_eps-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,128 +1,240 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_hpblade
|
||||
#
|
||||
# Module for managing Stonith for fence_hpblade.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*missing_as_off*]
|
||||
# Missing port returns OFF instead of failure
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_hpblade (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$missing_as_off = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$missing_as_off_chunk = $missing_as_off ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "missing_as_off=\"${missing_as_off}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -131,23 +243,23 @@ define pacemaker::stonith::fence_hpblade (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_hpblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_hpblade-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-hpblade": ensure => installed,
|
||||
'fence-agents-hpblade': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_hpblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_hpblade-${safe_title} fence_hpblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_hpblade-${safe_title} fence_hpblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_hpblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_hpblade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_hpblade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ibmblade
|
||||
#
|
||||
# Module for managing Stonith for fence_ibmblade.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ibmblade (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_ibmblade (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ibmblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ibmblade-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ibmblade": ensure => installed,
|
||||
'fence-agents-ibmblade': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ibmblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ibmblade-${safe_title} fence_ibmblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ibmblade-${safe_title} fence_ibmblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ibmblade-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ibmblade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ibmblade-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,168 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_idrac
|
||||
#
|
||||
# Module for managing Stonith for fence_idrac.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*auth*]
|
||||
# IPMI Lan Auth type (md5, password, or none)
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IPMI Lan IP to talk to
|
||||
#
|
||||
# [*passwd*]
|
||||
# Password (if required) to control power on IPMI device
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password (if required)
|
||||
#
|
||||
# [*lanplus*]
|
||||
# Use Lanplus to improve security of connection
|
||||
#
|
||||
# [*login*]
|
||||
# Username/Login (if required) to control power on IPMI device
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout (sec) for IPMI operation
|
||||
#
|
||||
# [*cipher*]
|
||||
# Ciphersuite to use (same as ipmitool -C parameter)
|
||||
#
|
||||
# [*method*]
|
||||
# Method to fence (onoff or cycle)
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after on/off operation
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*privlvl*]
|
||||
# Privilege level on IPMI device
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_idrac (
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$lanplus_chunk = $lanplus ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "lanplus=\"${lanplus}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$cipher_chunk = $cipher ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cipher=\"${cipher}\"",
|
||||
}
|
||||
$method_chunk = $method ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "method=\"${method}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$privlvl_chunk = $privlvl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "privlvl=\"${privlvl}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -86,23 +171,23 @@ define pacemaker::stonith::fence_idrac (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_idrac-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_idrac-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_idrac-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_idrac-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipmilan": ensure => installed,
|
||||
'fence-agents-ipmilan': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_idrac-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_idrac-${safe_title} fence_idrac pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_idrac-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_idrac-${safe_title} fence_idrac pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_idrac-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_idrac-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_idrac-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_idrac-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ifmib
|
||||
#
|
||||
# Module for managing Stonith for fence_ifmib.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ifmib (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_ifmib (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ifmib-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ifmib-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ifmib": ensure => installed,
|
||||
'fence-agents-ifmib': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ifmib-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ifmib-${safe_title} fence_ifmib pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ifmib-${safe_title} fence_ifmib pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ifmib-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ifmib-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ifmib-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,118 +1,224 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ilo
|
||||
#
|
||||
# Module for managing Stonith for fence_ilo.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*ssl*]
|
||||
# SSL connection
|
||||
#
|
||||
# [*notls*]
|
||||
# Disable TLS negotiation
|
||||
#
|
||||
# [*ribcl*]
|
||||
# Force ribcl version to use
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*ssl_secure*]
|
||||
# SSL connection with verifying fence device's certificate
|
||||
#
|
||||
# [*ssl_insecure*]
|
||||
# SSL connection without verifying fence device's certificate
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ilo (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$ribcl = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$ribcl = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$ssl_chunk = $ssl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl=\"${ssl}\"",
|
||||
}
|
||||
$notls_chunk = $notls ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "notls=\"${notls}\"",
|
||||
}
|
||||
$ribcl_chunk = $ribcl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ribcl=\"${ribcl}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$ssl_secure_chunk = $ssl_secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_secure=\"${ssl_secure}\"",
|
||||
}
|
||||
$ssl_insecure_chunk = $ssl_insecure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_insecure=\"${ssl_insecure}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -121,23 +227,23 @@ define pacemaker::stonith::fence_ilo (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ilo-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ilo-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ilo2": ensure => installed,
|
||||
'fence-agents-ilo2': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ilo-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo-${safe_title} fence_ilo pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo-${safe_title} fence_ilo pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ilo-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,118 +1,224 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ilo2
|
||||
#
|
||||
# Module for managing Stonith for fence_ilo2.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*ssl*]
|
||||
# SSL connection
|
||||
#
|
||||
# [*notls*]
|
||||
# Disable TLS negotiation
|
||||
#
|
||||
# [*ribcl*]
|
||||
# Force ribcl version to use
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*ssl_secure*]
|
||||
# SSL connection with verifying fence device's certificate
|
||||
#
|
||||
# [*ssl_insecure*]
|
||||
# SSL connection without verifying fence device's certificate
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ilo2 (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$ribcl = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$ribcl = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$ssl_chunk = $ssl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl=\"${ssl}\"",
|
||||
}
|
||||
$notls_chunk = $notls ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "notls=\"${notls}\"",
|
||||
}
|
||||
$ribcl_chunk = $ribcl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ribcl=\"${ribcl}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$ssl_secure_chunk = $ssl_secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_secure=\"${ssl_secure}\"",
|
||||
}
|
||||
$ssl_insecure_chunk = $ssl_insecure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_insecure=\"${ssl_insecure}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -121,23 +227,23 @@ define pacemaker::stonith::fence_ilo2 (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ilo2-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ilo2-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ilo2": ensure => installed,
|
||||
'fence-agents-ilo2': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ilo2-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo2-${safe_title} fence_ilo2 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo2-${safe_title} fence_ilo2 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ilo2-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo2-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo2-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,168 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ilo3
|
||||
#
|
||||
# Module for managing Stonith for fence_ilo3.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*auth*]
|
||||
# IPMI Lan Auth type (md5, password, or none)
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IPMI Lan IP to talk to
|
||||
#
|
||||
# [*passwd*]
|
||||
# Password (if required) to control power on IPMI device
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password (if required)
|
||||
#
|
||||
# [*lanplus*]
|
||||
# Use Lanplus to improve security of connection
|
||||
#
|
||||
# [*login*]
|
||||
# Username/Login (if required) to control power on IPMI device
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout (sec) for IPMI operation
|
||||
#
|
||||
# [*cipher*]
|
||||
# Ciphersuite to use (same as ipmitool -C parameter)
|
||||
#
|
||||
# [*method*]
|
||||
# Method to fence (onoff or cycle)
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after on/off operation
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*privlvl*]
|
||||
# Privilege level on IPMI device
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ilo3 (
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$lanplus_chunk = $lanplus ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "lanplus=\"${lanplus}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$cipher_chunk = $cipher ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cipher=\"${cipher}\"",
|
||||
}
|
||||
$method_chunk = $method ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "method=\"${method}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$privlvl_chunk = $privlvl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "privlvl=\"${privlvl}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -86,23 +171,23 @@ define pacemaker::stonith::fence_ilo3 (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ilo3-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ilo3-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipmilan": ensure => installed,
|
||||
'fence-agents-ipmilan': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ilo3-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo3-${safe_title} fence_ilo3 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo3-${safe_title} fence_ilo3 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ilo3-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo3-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo3-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,168 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ilo4
|
||||
#
|
||||
# Module for managing Stonith for fence_ilo4.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*auth*]
|
||||
# IPMI Lan Auth type (md5, password, or none)
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IPMI Lan IP to talk to
|
||||
#
|
||||
# [*passwd*]
|
||||
# Password (if required) to control power on IPMI device
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password (if required)
|
||||
#
|
||||
# [*lanplus*]
|
||||
# Use Lanplus to improve security of connection
|
||||
#
|
||||
# [*login*]
|
||||
# Username/Login (if required) to control power on IPMI device
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout (sec) for IPMI operation
|
||||
#
|
||||
# [*cipher*]
|
||||
# Ciphersuite to use (same as ipmitool -C parameter)
|
||||
#
|
||||
# [*method*]
|
||||
# Method to fence (onoff or cycle)
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after on/off operation
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*privlvl*]
|
||||
# Privilege level on IPMI device
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ilo4 (
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$lanplus_chunk = $lanplus ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "lanplus=\"${lanplus}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$cipher_chunk = $cipher ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cipher=\"${cipher}\"",
|
||||
}
|
||||
$method_chunk = $method ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "method=\"${method}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$privlvl_chunk = $privlvl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "privlvl=\"${privlvl}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -86,23 +171,23 @@ define pacemaker::stonith::fence_ilo4 (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ilo4-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ilo4-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipmilan": ensure => installed,
|
||||
'fence-agents-ipmilan': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ilo4-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo4-${safe_title} fence_ilo4 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo4-${safe_title} fence_ilo4 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ilo4-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo4-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo4-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,113 +1,216 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ilo_mp
|
||||
#
|
||||
# Module for managing Stonith for fence_ilo_mp.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ilo_mp (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$secure = undef,
|
||||
$cmd_prompt = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$secure = undef,
|
||||
$cmd_prompt = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -116,23 +219,23 @@ define pacemaker::stonith::fence_ilo_mp (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ilo_mp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ilo_mp-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ilo-mp": ensure => installed,
|
||||
'fence-agents-ilo-mp': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ilo_mp-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo_mp-${safe_title} fence_ilo_mp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ilo_mp-${safe_title} fence_ilo_mp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ilo_mp-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo_mp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ilo_mp-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,168 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_imm
|
||||
#
|
||||
# Module for managing Stonith for fence_imm.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*auth*]
|
||||
# IPMI Lan Auth type (md5, password, or none)
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IPMI Lan IP to talk to
|
||||
#
|
||||
# [*passwd*]
|
||||
# Password (if required) to control power on IPMI device
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password (if required)
|
||||
#
|
||||
# [*lanplus*]
|
||||
# Use Lanplus to improve security of connection
|
||||
#
|
||||
# [*login*]
|
||||
# Username/Login (if required) to control power on IPMI device
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout (sec) for IPMI operation
|
||||
#
|
||||
# [*cipher*]
|
||||
# Ciphersuite to use (same as ipmitool -C parameter)
|
||||
#
|
||||
# [*method*]
|
||||
# Method to fence (onoff or cycle)
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after on/off operation
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*privlvl*]
|
||||
# Privilege level on IPMI device
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_imm (
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$lanplus_chunk = $lanplus ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "lanplus=\"${lanplus}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$cipher_chunk = $cipher ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cipher=\"${cipher}\"",
|
||||
}
|
||||
$method_chunk = $method ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "method=\"${method}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$privlvl_chunk = $privlvl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "privlvl=\"${privlvl}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -86,23 +171,23 @@ define pacemaker::stonith::fence_imm (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_imm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_imm-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_imm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_imm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipmilan": ensure => installed,
|
||||
'fence-agents-ipmilan': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_imm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_imm-${safe_title} fence_imm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_imm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_imm-${safe_title} fence_imm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_imm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_imm-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_imm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_imm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_intelmodular
|
||||
#
|
||||
# Module for managing Stonith for fence_intelmodular.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_intelmodular (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_intelmodular (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_intelmodular-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_intelmodular-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-intelmodular": ensure => installed,
|
||||
'fence-agents-intelmodular': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_intelmodular-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_intelmodular-${safe_title} fence_intelmodular pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_intelmodular-${safe_title} fence_intelmodular pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_intelmodular-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_intelmodular-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_intelmodular-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,256 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ipdu
|
||||
#
|
||||
# Module for managing Stonith for fence_ipdu.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*snmp_version*]
|
||||
# Specifies SNMP version to use (1,2c,3)
|
||||
#
|
||||
# [*community*]
|
||||
# Set the community string
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*snmp_auth_prot*]
|
||||
# Set authentication protocol (MD5|SHA)
|
||||
#
|
||||
# [*snmp_sec_level*]
|
||||
# Set security level (noAuthNoPriv|authNoPriv|authPriv)
|
||||
#
|
||||
# [*snmp_priv_prot*]
|
||||
# Set privacy protocol (DES|AES)
|
||||
#
|
||||
# [*snmp_priv_passwd*]
|
||||
# Set privacy protocol password
|
||||
#
|
||||
# [*snmp_priv_passwd_script*]
|
||||
# Script to run to retrieve privacy password
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ipdu (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$port = undef,
|
||||
$snmp_version = undef,
|
||||
$community = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$snmp_auth_prot = undef,
|
||||
$snmp_sec_level = undef,
|
||||
$snmp_priv_prot = undef,
|
||||
$snmp_priv_passwd = undef,
|
||||
$snmp_priv_passwd_script = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$snmp_version_chunk = $snmp_version ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_version=\"${snmp_version}\"",
|
||||
}
|
||||
$community_chunk = $community ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "community=\"${community}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$snmp_auth_prot_chunk = $snmp_auth_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_auth_prot=\"${snmp_auth_prot}\"",
|
||||
}
|
||||
$snmp_sec_level_chunk = $snmp_sec_level ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_sec_level=\"${snmp_sec_level}\"",
|
||||
}
|
||||
$snmp_priv_prot_chunk = $snmp_priv_prot ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_prot=\"${snmp_priv_prot}\"",
|
||||
}
|
||||
$snmp_priv_passwd_chunk = $snmp_priv_passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"",
|
||||
}
|
||||
$snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -141,23 +259,23 @@ define pacemaker::stonith::fence_ipdu (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ipdu-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ipdu-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipdu": ensure => installed,
|
||||
'fence-agents-ipdu': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ipdu-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ipdu-${safe_title} fence_ipdu pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ipdu-${safe_title} fence_ipdu pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ipdu-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ipdu-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ipdu-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,168 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_ipmilan
|
||||
#
|
||||
# Module for managing Stonith for fence_ipmilan.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*auth*]
|
||||
# IPMI Lan Auth type (md5, password, or none)
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IPMI Lan IP to talk to
|
||||
#
|
||||
# [*passwd*]
|
||||
# Password (if required) to control power on IPMI device
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password (if required)
|
||||
#
|
||||
# [*lanplus*]
|
||||
# Use Lanplus to improve security of connection
|
||||
#
|
||||
# [*login*]
|
||||
# Username/Login (if required) to control power on IPMI device
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout (sec) for IPMI operation
|
||||
#
|
||||
# [*cipher*]
|
||||
# Ciphersuite to use (same as ipmitool -C parameter)
|
||||
#
|
||||
# [*method*]
|
||||
# Method to fence (onoff or cycle)
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after on/off operation
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*privlvl*]
|
||||
# Privilege level on IPMI device
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_ipmilan (
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
$auth = undef,
|
||||
$ipaddr = undef,
|
||||
$passwd = undef,
|
||||
$passwd_script = undef,
|
||||
$lanplus = undef,
|
||||
$login = undef,
|
||||
$timeout = undef,
|
||||
$cipher = undef,
|
||||
$method = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$privlvl = undef,
|
||||
$verbose = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$lanplus_chunk = $lanplus ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "lanplus=\"${lanplus}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$cipher_chunk = $cipher ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cipher=\"${cipher}\"",
|
||||
}
|
||||
$method_chunk = $method ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "method=\"${method}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$privlvl_chunk = $privlvl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "privlvl=\"${privlvl}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -86,23 +171,23 @@ define pacemaker::stonith::fence_ipmilan (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_ipmilan-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_ipmilan-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-ipmilan": ensure => installed,
|
||||
'fence-agents-ipmilan': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_ipmilan-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ipmilan-${safe_title} fence_ipmilan pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_ipmilan-${safe_title} fence_ipmilan pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_ipmilan-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ipmilan-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_ipmilan-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,112 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_kdump
|
||||
#
|
||||
# Module for managing Stonith for fence_kdump.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*nodename*]
|
||||
# Name or IP address of node to be fenced
|
||||
#
|
||||
# [*ipport*]
|
||||
# Port number
|
||||
#
|
||||
# [*family*]
|
||||
# Network family
|
||||
#
|
||||
# [*timeout*]
|
||||
# Timeout in seconds
|
||||
#
|
||||
# [*verbose*]
|
||||
# Print verbose output
|
||||
#
|
||||
# [*usage*]
|
||||
# Print usage
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_kdump (
|
||||
$nodename = undef,
|
||||
$ipport = undef,
|
||||
$family = undef,
|
||||
$timeout = undef,
|
||||
$verbose = undef,
|
||||
$usage = undef,
|
||||
$nodename = undef,
|
||||
$ipport = undef,
|
||||
$family = undef,
|
||||
$timeout = undef,
|
||||
$verbose = undef,
|
||||
$usage = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$nodename_chunk = $nodename ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "nodename=\"${nodename}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$family_chunk = $family ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "family=\"${family}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$usage_chunk = $usage ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "usage=\"${usage}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -51,23 +115,23 @@ define pacemaker::stonith::fence_kdump (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_kdump-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_kdump-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_kdump-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_kdump-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-kdump": ensure => installed,
|
||||
'fence-agents-kdump': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_kdump-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_kdump-${safe_title} fence_kdump pcmk_host_list=\"${pcmk_host_value_chunk}\" ${nodename_chunk} ${ipport_chunk} ${family_chunk} ${timeout_chunk} ${verbose_chunk} ${usage_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_kdump-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_kdump-${safe_title} fence_kdump pcmk_host_list=\"${pcmk_host_value_chunk}\" ${nodename_chunk} ${ipport_chunk} ${family_chunk} ${timeout_chunk} ${verbose_chunk} ${usage_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_kdump-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_kdump-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_kdump-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_kdump-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,232 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_rhevm
|
||||
#
|
||||
# Module for managing Stonith for fence_rhevm.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*ssl*]
|
||||
# SSL connection
|
||||
#
|
||||
# [*notls*]
|
||||
# Disable TLS negotiation
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*ssl_secure*]
|
||||
# SSL connection with verifying fence device's certificate
|
||||
#
|
||||
# [*ssl_insecure*]
|
||||
# SSL connection without verifying fence device's certificate
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_rhevm (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$ssl_chunk = $ssl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl=\"${ssl}\"",
|
||||
}
|
||||
$notls_chunk = $notls ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "notls=\"${notls}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$ssl_secure_chunk = $ssl_secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_secure=\"${ssl_secure}\"",
|
||||
}
|
||||
$ssl_insecure_chunk = $ssl_insecure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_insecure=\"${ssl_insecure}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -126,23 +235,23 @@ define pacemaker::stonith::fence_rhevm (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_rhevm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_rhevm-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-rhevm": ensure => installed,
|
||||
'fence-agents-rhevm': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_rhevm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_rhevm-${safe_title} fence_rhevm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_rhevm-${safe_title} fence_rhevm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_rhevm-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_rhevm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_rhevm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,113 +1,216 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_rsb
|
||||
#
|
||||
# Module for managing Stonith for fence_rsb.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_rsb (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$secure = undef,
|
||||
$cmd_prompt = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$secure = undef,
|
||||
$cmd_prompt = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -116,23 +219,23 @@ define pacemaker::stonith::fence_rsb (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_rsb-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_rsb-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_rsb-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_rsb-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-rsb": ensure => installed,
|
||||
'fence-agents-rsb': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_rsb-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_rsb-${safe_title} fence_rsb pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_rsb-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_rsb-${safe_title} fence_rsb pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_rsb-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_rsb-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_rsb-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_rsb-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,112 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_scsi
|
||||
#
|
||||
# Module for managing Stonith for fence_scsi.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*aptpl*]
|
||||
# Use APTPL flag for registrations
|
||||
#
|
||||
# [*devices*]
|
||||
# List of devices to be used for fencing action
|
||||
#
|
||||
# [*logfile*]
|
||||
# File to write error/debug messages
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*key*]
|
||||
# Key value to be used for fencing action
|
||||
#
|
||||
# [*nodename*]
|
||||
# Name of node
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_scsi (
|
||||
$aptpl = undef,
|
||||
$devices = undef,
|
||||
$logfile = undef,
|
||||
$delay = undef,
|
||||
$key = undef,
|
||||
$nodename = undef,
|
||||
$aptpl = undef,
|
||||
$devices = undef,
|
||||
$logfile = undef,
|
||||
$delay = undef,
|
||||
$key = undef,
|
||||
$nodename = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$aptpl_chunk = $aptpl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "aptpl=\"${aptpl}\"",
|
||||
}
|
||||
$devices_chunk = $devices ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "devices=\"${devices}\"",
|
||||
}
|
||||
$logfile_chunk = $logfile ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "logfile=\"${logfile}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$key_chunk = $key ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "key=\"${key}\"",
|
||||
}
|
||||
$nodename_chunk = $nodename ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "nodename=\"${nodename}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -51,23 +115,23 @@ define pacemaker::stonith::fence_scsi (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_scsi-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_scsi-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_scsi-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_scsi-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-scsi": ensure => installed,
|
||||
'fence-agents-scsi': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_scsi-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_scsi-${safe_title} fence_scsi pcmk_host_list=\"${pcmk_host_value_chunk}\" ${aptpl_chunk} ${devices_chunk} ${logfile_chunk} ${delay_chunk} ${key_chunk} ${nodename_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_scsi-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_scsi-${safe_title} fence_scsi pcmk_host_list=\"${pcmk_host_value_chunk}\" ${aptpl_chunk} ${devices_chunk} ${logfile_chunk} ${delay_chunk} ${key_chunk} ${nodename_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_scsi-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_scsi-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_scsi-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_scsi-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +1,136 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_virt
|
||||
#
|
||||
# Module for managing Stonith for fence_virt.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*debug*]
|
||||
# Specify (stdin) or increment (command line) debug level
|
||||
#
|
||||
# [*serial_device*]
|
||||
# Serial device (default=/dev/ttyS1)
|
||||
#
|
||||
# [*serial_params*]
|
||||
# Serial Parameters (default=115200,8N1)
|
||||
#
|
||||
# [*channel_address*]
|
||||
# VM Channel IP address (default=10.0.2.179)
|
||||
#
|
||||
# [*ipport*]
|
||||
# Multicast or VMChannel IP port (default=1229)
|
||||
#
|
||||
# [*port*]
|
||||
# Virtual Machine (domain name) to fence
|
||||
#
|
||||
# [*timeout*]
|
||||
# Fencing timeout (in seconds; default=30)
|
||||
#
|
||||
# [*delay*]
|
||||
# Fencing delay (in seconds; default=0)
|
||||
#
|
||||
# [*domain*]
|
||||
# Virtual Machine (domain name) to fence (deprecated; use port)
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_virt (
|
||||
$debug = undef,
|
||||
$serial_device = undef,
|
||||
$serial_params = undef,
|
||||
$debug = undef,
|
||||
$serial_device = undef,
|
||||
$serial_params = undef,
|
||||
$channel_address = undef,
|
||||
$ipport = undef,
|
||||
$port = undef,
|
||||
$timeout = undef,
|
||||
$delay = undef,
|
||||
$domain = undef,
|
||||
$ipport = undef,
|
||||
$port = undef,
|
||||
$timeout = undef,
|
||||
$delay = undef,
|
||||
$domain = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$serial_device_chunk = $serial_device ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "serial_device=\"${serial_device}\"",
|
||||
}
|
||||
$serial_params_chunk = $serial_params ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "serial_params=\"${serial_params}\"",
|
||||
}
|
||||
$channel_address_chunk = $channel_address ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "channel_address=\"${channel_address}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$domain_chunk = $domain ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "domain=\"${domain}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -66,23 +139,23 @@ define pacemaker::stonith::fence_virt (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_virt-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_virt-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_virt-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_virt-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-virt": ensure => installed,
|
||||
'fence-virt': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_virt-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_virt-${safe_title} fence_virt pcmk_host_list=\"${pcmk_host_value_chunk}\" ${debug_chunk} ${serial_device_chunk} ${serial_params_chunk} ${channel_address_chunk} ${ipport_chunk} ${port_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_virt-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_virt-${safe_title} fence_virt pcmk_host_list=\"${pcmk_host_value_chunk}\" ${debug_chunk} ${serial_device_chunk} ${serial_params_chunk} ${channel_address_chunk} ${ipport_chunk} ${port_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_virt-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_virt-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_virt-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_virt-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,232 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_vmware_soap
|
||||
#
|
||||
# Module for managing Stonith for fence_vmware_soap.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*ssl*]
|
||||
# SSL connection
|
||||
#
|
||||
# [*notls*]
|
||||
# Disable TLS negotiation
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*ssl_secure*]
|
||||
# SSL connection with verifying fence device's certificate
|
||||
#
|
||||
# [*ssl_insecure*]
|
||||
# SSL connection without verifying fence device's certificate
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_vmware_soap (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$ssl = undef,
|
||||
$notls = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$ssl_secure = undef,
|
||||
$ssl_insecure = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$ssl_chunk = $ssl ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl=\"${ssl}\"",
|
||||
}
|
||||
$notls_chunk = $notls ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "notls=\"${notls}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$ssl_secure_chunk = $ssl_secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_secure=\"${ssl_secure}\"",
|
||||
}
|
||||
$ssl_insecure_chunk = $ssl_insecure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssl_insecure=\"${ssl_insecure}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -126,23 +235,23 @@ define pacemaker::stonith::fence_vmware_soap (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_vmware_soap-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_vmware_soap-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-vmware-soap": ensure => installed,
|
||||
'fence-agents-vmware-soap': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_vmware_soap-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_vmware_soap-${safe_title} fence_vmware_soap pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_vmware_soap-${safe_title} fence_vmware_soap pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_vmware_soap-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_vmware_soap-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_vmware_soap-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,232 @@
|
||||
# generated by agent_generator.rb, manual changes will be lost
|
||||
|
||||
# == Define: pacemaker::stonith::fence_wti
|
||||
#
|
||||
# Module for managing Stonith for fence_wti.
|
||||
#
|
||||
# WARNING: Generated by "rake generate_stonith", manual changes will
|
||||
# be lost.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ipaddr*]
|
||||
# IP Address or Hostname
|
||||
#
|
||||
# [*login*]
|
||||
# Login Name
|
||||
#
|
||||
# [*passwd*]
|
||||
# Login password or passphrase
|
||||
#
|
||||
# [*cmd_prompt*]
|
||||
# Force Python regex for command prompt
|
||||
#
|
||||
# [*secure*]
|
||||
# SSH connection
|
||||
#
|
||||
# [*port*]
|
||||
# Physical plug number, name of virtual machine or UUID
|
||||
#
|
||||
# [*ipport*]
|
||||
# TCP/UDP port to use for connection with device
|
||||
#
|
||||
# [*inet4_only*]
|
||||
# Forces agent to use IPv4 addresses only
|
||||
#
|
||||
# [*inet6_only*]
|
||||
# Forces agent to use IPv6 addresses only
|
||||
#
|
||||
# [*passwd_script*]
|
||||
# Script to retrieve password
|
||||
#
|
||||
# [*identity_file*]
|
||||
# Identity file for ssh
|
||||
#
|
||||
# [*ssh_options*]
|
||||
# SSH options to use
|
||||
#
|
||||
# [*verbose*]
|
||||
# Verbose mode
|
||||
#
|
||||
# [*debug*]
|
||||
# Write debug information to given file
|
||||
#
|
||||
# [*separator*]
|
||||
# Separator for CSV created by operation list
|
||||
#
|
||||
# [*power_timeout*]
|
||||
# Test X seconds for status change after ON/OFF
|
||||
#
|
||||
# [*shell_timeout*]
|
||||
# Wait X seconds for cmd prompt after issuing command
|
||||
#
|
||||
# [*login_timeout*]
|
||||
# Wait X seconds for cmd prompt after login
|
||||
#
|
||||
# [*power_wait*]
|
||||
# Wait X seconds after issuing ON/OFF
|
||||
#
|
||||
# [*delay*]
|
||||
# Wait X seconds before fencing is started
|
||||
#
|
||||
# [*retry_on*]
|
||||
# Count of attempts to retry power on
|
||||
#
|
||||
# [*interval*]
|
||||
# Interval between tries.
|
||||
#
|
||||
# [*ensure*]
|
||||
# The desired state of the resource.
|
||||
#
|
||||
# [*tries*]
|
||||
# The numbre of tries.
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# Time to sleep between tries.
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# List of Pacemaker hosts.
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Generated by rake generate_stonith task.
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_wti (
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
$ipaddr = undef,
|
||||
$login = undef,
|
||||
$passwd = undef,
|
||||
$cmd_prompt = undef,
|
||||
$secure = undef,
|
||||
$port = undef,
|
||||
$ipport = undef,
|
||||
$inet4_only = undef,
|
||||
$inet6_only = undef,
|
||||
$passwd_script = undef,
|
||||
$identity_file = undef,
|
||||
$ssh_options = undef,
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$separator = undef,
|
||||
$power_timeout = undef,
|
||||
$shell_timeout = undef,
|
||||
$login_timeout = undef,
|
||||
$power_wait = undef,
|
||||
$delay = undef,
|
||||
$retry_on = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
|
||||
) {
|
||||
$ipaddr_chunk = $ipaddr ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipaddr=\"${ipaddr}\"",
|
||||
}
|
||||
$login_chunk = $login ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login=\"${login}\"",
|
||||
}
|
||||
$passwd_chunk = $passwd ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd=\"${passwd}\"",
|
||||
}
|
||||
$cmd_prompt_chunk = $cmd_prompt ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "cmd_prompt=\"${cmd_prompt}\"",
|
||||
}
|
||||
$secure_chunk = $secure ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "secure=\"${secure}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$inet4_only_chunk = $inet4_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet4_only=\"${inet4_only}\"",
|
||||
}
|
||||
$inet6_only_chunk = $inet6_only ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "inet6_only=\"${inet6_only}\"",
|
||||
}
|
||||
$passwd_script_chunk = $passwd_script ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "passwd_script=\"${passwd_script}\"",
|
||||
}
|
||||
$identity_file_chunk = $identity_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "identity_file=\"${identity_file}\"",
|
||||
}
|
||||
$ssh_options_chunk = $ssh_options ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ssh_options=\"${ssh_options}\"",
|
||||
}
|
||||
$verbose_chunk = $verbose ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "verbose=\"${verbose}\"",
|
||||
}
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$separator_chunk = $separator ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "separator=\"${separator}\"",
|
||||
}
|
||||
$power_timeout_chunk = $power_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_timeout=\"${power_timeout}\"",
|
||||
}
|
||||
$shell_timeout_chunk = $shell_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "shell_timeout=\"${shell_timeout}\"",
|
||||
}
|
||||
$login_timeout_chunk = $login_timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "login_timeout=\"${login_timeout}\"",
|
||||
}
|
||||
$power_wait_chunk = $power_wait ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "power_wait=\"${power_wait}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$retry_on_chunk = $retry_on ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retry_on=\"${retry_on}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -126,23 +235,23 @@ define pacemaker::stonith::fence_wti (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_wti-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_wti-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_wti-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_wti-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
package {
|
||||
"fence-agents-wti": ensure => installed,
|
||||
'fence-agents-wti': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_wti-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_wti-${safe_title} fence_wti pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_wti-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_wti-${safe_title} fence_wti pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_wti-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_wti-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_wti-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_wti-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +1,202 @@
|
||||
# == Define: pacemaker::stonith::fence_xvm
|
||||
#
|
||||
# Configures stonith to use fence_xvm
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*debug*]
|
||||
# (optional) Specify (stdin) or increment (command line) debug level
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*ip_family*]
|
||||
# (optional) IP Family ([auto], ipv4, ipv6)
|
||||
# Defaults to 'auto'
|
||||
#
|
||||
# [*multicast_address*]
|
||||
# (optional) Multicast address
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*ipport*]
|
||||
# (optional) TCP, Multicast, or VMChannel IP port
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*retrans*]
|
||||
# (optional) Multicast retransmit time (in 1/10sec)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*auth*]
|
||||
# (optional) Authentication (none, sha1, [sha256], sha512)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*hash*]
|
||||
# (optional) Packet hash strength (none, sha1, [sha256], sha512)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*key_file*]
|
||||
# (optional) Shared key file
|
||||
# Defaults to /etc/cluster/fence_xvm.key
|
||||
#
|
||||
# [*port*]
|
||||
# (optional) Virtual Machine (domain name) to fence
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*use_uuid*]
|
||||
# (optional) Treat [domain] as UUID instead of domain name. This is provided
|
||||
# forcompatibility with older fence_xvmd installations.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*timeout*]
|
||||
# (optional) Fencing timeout (in seconds)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*delay*]
|
||||
# (optional) Fencing delay (in seconds)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*domain*]
|
||||
# (optional) DEPRECATED, for compatibility only, use port. Virtual Machine
|
||||
# (domain name) to fence
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*interval*]
|
||||
# (optional) Monitor interval
|
||||
# Defaults to 60s
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Whether to make sure resource is present or absent
|
||||
# Defaults to present
|
||||
#
|
||||
# [*pcmk_host_list*]
|
||||
# (optional) List of nodes
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*manage_key_file*]
|
||||
# (optional) Whether to create the keyfile if not present
|
||||
# Defaults to false
|
||||
#
|
||||
# [*key_file_password*]
|
||||
# (optional) Password for the key_file
|
||||
# Defaults to 123456
|
||||
#
|
||||
# [*manage_fw*]
|
||||
# (optional) Whether to manage the firewall settings related to this fencing
|
||||
# type
|
||||
# Defaults to true
|
||||
#
|
||||
# [*tries*]
|
||||
# (optional) How many times to attempt creating or deleting this resource
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*try_sleep*]
|
||||
# (optional) How long to wait between tries
|
||||
# Defaults to undef
|
||||
#
|
||||
# === Dependencies
|
||||
# None
|
||||
#
|
||||
# === Authors:
|
||||
# Jiri Stransky <jistr@redhat.com>
|
||||
# Crag Wolfe <cwolfe@redhat.com>
|
||||
# Jason Guiditta <jguiditt@redhat.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat 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.
|
||||
#
|
||||
define pacemaker::stonith::fence_xvm (
|
||||
$debug = undef,
|
||||
$ip_family = undef,
|
||||
$debug = undef,
|
||||
$ip_family = undef,
|
||||
$multicast_address = undef,
|
||||
$ipport = undef,
|
||||
$retrans = undef,
|
||||
$auth = undef,
|
||||
$hash = undef,
|
||||
$key_file = undef,
|
||||
$port = undef,
|
||||
$use_uuid = undef,
|
||||
$timeout = undef,
|
||||
$delay = undef,
|
||||
$domain = undef,
|
||||
$ipport = undef,
|
||||
$retrans = undef,
|
||||
$auth = undef,
|
||||
$hash = undef,
|
||||
$key_file = '/etc/cluster/fence_xvm.key',
|
||||
$port = undef,
|
||||
$use_uuid = undef,
|
||||
$timeout = undef,
|
||||
$delay = undef,
|
||||
$domain = undef,
|
||||
|
||||
$interval = "60s",
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
$interval = '60s',
|
||||
$ensure = present,
|
||||
$pcmk_host_list = undef,
|
||||
|
||||
$manage_key_file = false,
|
||||
$key_file = "/etc/cluster/fence_xvm.key",
|
||||
$key_file_password = "123456",
|
||||
$manage_fw = true,
|
||||
$manage_key_file = false,
|
||||
$key_file_password = '123456',
|
||||
$manage_fw = true,
|
||||
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
$tries = undef,
|
||||
$try_sleep = undef,
|
||||
) {
|
||||
$debug_chunk = $debug ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "debug=\"${debug}\"",
|
||||
}
|
||||
$ip_family_chunk = $ip_family ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ip_family=\"${ip_family}\"",
|
||||
}
|
||||
$multicast_address_chunk = $multicast_address ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "multicast_address=\"${multicast_address}\"",
|
||||
}
|
||||
$ipport_chunk = $ipport ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "ipport=\"${ipport}\"",
|
||||
}
|
||||
$retrans_chunk = $retrans ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "retrans=\"${retrans}\"",
|
||||
}
|
||||
$auth_chunk = $auth ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "auth=\"${auth}\"",
|
||||
}
|
||||
$hash_chunk = $hash ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "hash=\"${hash}\"",
|
||||
}
|
||||
$key_file_chunk = $key_file ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "key_file=\"${key_file}\"",
|
||||
}
|
||||
$port_chunk = $port ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "port=\"${port}\"",
|
||||
}
|
||||
$use_uuid_chunk = $use_uuid ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "use_uuid=\"${use_uuid}\"",
|
||||
}
|
||||
$timeout_chunk = $timeout ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "timeout=\"${timeout}\"",
|
||||
}
|
||||
$delay_chunk = $delay ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "delay=\"${delay}\"",
|
||||
}
|
||||
$domain_chunk = $domain ? {
|
||||
undef => "",
|
||||
undef => '',
|
||||
default => "domain=\"${domain}\"",
|
||||
}
|
||||
|
||||
$pcmk_host_value_chunk = $pcmk_host_list ? {
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => "${pcmk_host_list}",
|
||||
undef => '$(/usr/sbin/crm_node -n)',
|
||||
default => $pcmk_host_list,
|
||||
}
|
||||
|
||||
# $title can be a mac address, remove the colons for pcmk resource name
|
||||
@@ -89,42 +205,42 @@ define pacemaker::stonith::fence_xvm (
|
||||
if($ensure == absent) {
|
||||
exec { "Delete stonith-fence_xvm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-fence_xvm-${safe_title}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_xvm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class["pacemaker::corosync"],
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-fence_xvm-${safe_title} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
if str2bool($manage_key_file) {
|
||||
file { "$key_file":
|
||||
content => "$key_file_password",
|
||||
file { $key_file:
|
||||
content => $key_file_password,
|
||||
}
|
||||
}
|
||||
if str2bool($manage_fw) {
|
||||
firewall { "003 fence_xvm":
|
||||
proto => 'igmp',
|
||||
action => 'accept',
|
||||
firewall { '003 fence_xvm':
|
||||
proto => 'igmp',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "003 fence_xvm ipv6":
|
||||
firewall { '003 fence_xvm ipv6':
|
||||
proto => 'igmp',
|
||||
action => 'accept',
|
||||
provider => 'ip6tables',
|
||||
}
|
||||
firewall { "004 fence_xvm":
|
||||
proto => 'udp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
firewall { '004 fence_xvm':
|
||||
proto => 'udp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "004 fence_xvm ipv6":
|
||||
firewall { '004 fence_xvm ipv6':
|
||||
proto => 'udp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
provider => 'ip6tables',
|
||||
}
|
||||
firewall { "005 fence_xvm":
|
||||
proto => 'tcp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
firewall { '005 fence_xvm':
|
||||
proto => 'tcp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "005 fence_xvm ipv6":
|
||||
firewall { '005 fence_xvm ipv6':
|
||||
proto => 'tcp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
@@ -133,18 +249,18 @@ define pacemaker::stonith::fence_xvm (
|
||||
}
|
||||
|
||||
package {
|
||||
"fence-virt": ensure => installed,
|
||||
'fence-virt': ensure => installed,
|
||||
} ->
|
||||
exec { "Create stonith-fence_xvm-${safe_title}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_xvm-${safe_title} fence_xvm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${debug_chunk} ${ip_family_chunk} ${multicast_address_chunk} ${ipport_chunk} ${retrans_chunk} ${auth_chunk} ${hash_chunk} ${key_file_chunk} ${port_chunk} ${use_uuid_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_xvm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs stonith create stonith-fence_xvm-${safe_title} fence_xvm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${debug_chunk} ${ip_family_chunk} ${multicast_address_chunk} ${ipport_chunk} ${retrans_chunk} ${auth_chunk} ${hash_chunk} ${key_file_chunk} ${port_chunk} ${use_uuid_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-fence_xvm-${safe_title} > /dev/null 2>&1",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
require => Class["pacemaker::corosync"],
|
||||
require => Class['pacemaker::corosync'],
|
||||
} ->
|
||||
exec { "Add non-local constraint for stonith-fence_xvm-${safe_title}":
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_xvm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
command => "/usr/sbin/pcs constraint location stonith-fence_xvm-${safe_title} avoids ${pcmk_host_value_chunk}",
|
||||
tries => $tries,
|
||||
try_sleep => $try_sleep,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
class pacemaker::stonith::ipmilan(
|
||||
$address ="10.10.10.1",
|
||||
$username ="",
|
||||
$password ="",
|
||||
$interval ="60s",
|
||||
$ensure ="present",
|
||||
$pcmk_host_list ="",
|
||||
) {
|
||||
if($ensure == absent) {
|
||||
exec { "Removing stonith::ipmilan ${address}":
|
||||
command => "/usr/sbin/pcs stonith delete stonith-ipmilan-${address}",
|
||||
onlyif => "/usr/sbin/pcs stonith show stonith-ipmilan-${address} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
$username_chunk = $username ? {
|
||||
'' => '',
|
||||
default => "login=${username}",
|
||||
}
|
||||
$password_chunk = $password ? {
|
||||
'' => '',
|
||||
default => "passwd=${password}",
|
||||
}
|
||||
$pcmk_host_list_chunk = $pcmk_host_list ? {
|
||||
'' => '',
|
||||
default => "pcmk_host_list=\"${pcmk_host_list}\"",
|
||||
}
|
||||
|
||||
package { "ipmitool":
|
||||
ensure => installed,
|
||||
} ->
|
||||
exec { "Creating stonith::ipmilan ${address}":
|
||||
command => "/usr/sbin/pcs stonith create stonith-ipmilan-${address} fence_ipmilan ${pcmk_host_list_chunk} ipaddr=${address} ${username_chunk} ${password_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show stonith-ipmilan-${address} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
# To use this class ensure that fence_virtd is properly configured and running on the hypervisor
|
||||
|
||||
class pacemaker::stonith::xvm(
|
||||
$name,
|
||||
$manage_key_file=false,
|
||||
$key_file="/etc/cluster/fence_xvm.key",
|
||||
$key_file_password="123456",
|
||||
$interval="30s",
|
||||
$ensure=present,
|
||||
$port=undef, # the name of the vm
|
||||
$pcmk_host=undef, # the hostname or IP that pacemaker uses
|
||||
$manage_fw = true,
|
||||
) {
|
||||
if($ensure == absent) {
|
||||
exec { "Removing stonith::xvm ${name}":
|
||||
command => "/usr/sbin/pcs stonith delete fence_xvm-${name }",
|
||||
onlyif => "/usr/sbin/pcs stonith show fence_xvm-${name} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
} else {
|
||||
$port_chunk = $port ? {
|
||||
'' => '',
|
||||
default => "port=${port}",
|
||||
}
|
||||
$pcmk_host_list_chunk = $pcmk_host ? {
|
||||
'' => 'pcmk_host_list=$(/usr/sbin/crm_node -n)',
|
||||
default => "pcmk_host_list=${pcmk_host}",
|
||||
}
|
||||
if $manage_key_file {
|
||||
file { "$key_file":
|
||||
content => "$key_file_password",
|
||||
}
|
||||
}
|
||||
if $manage_fw {
|
||||
firewall { "003 fence_xvm":
|
||||
proto => 'igmp',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "003 fence_xvm ipv6":
|
||||
proto => 'igmp',
|
||||
action => 'accept',
|
||||
provider => 'ip6tables',
|
||||
}
|
||||
firewall { "004 fence_xvm":
|
||||
proto => 'udp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "004 fence_xvm ipv6":
|
||||
proto => 'udp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
provider => 'ip6tables',
|
||||
}
|
||||
firewall { "005 fence_xvm":
|
||||
proto => 'tcp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
}
|
||||
firewall { "005 fence_xvm ipv6":
|
||||
proto => 'tcp',
|
||||
dport => '1229',
|
||||
action => 'accept',
|
||||
provider => 'ip6tables',
|
||||
}
|
||||
}
|
||||
|
||||
exec { "Creating stonith::xvm ${name}":
|
||||
command => "/usr/sbin/pcs stonith create fence_xvm-${name} fence_xvm ${port_chunk} ${pcmk_host_list_chunk} op monitor interval=${interval}",
|
||||
unless => "/usr/sbin/pcs stonith show fence_xvm-${name} > /dev/null 2>&1",
|
||||
require => Class['pacemaker::corosync'],
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,29 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'pacemaker' do
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) do
|
||||
facts
|
||||
end
|
||||
it { is_expected.to compile }
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
it { is_expected.to contain_class('pacemaker::install') }
|
||||
it { is_expected.to contain_class('pacemaker::service') }
|
||||
|
||||
case facts[:operatingsystemrelease]
|
||||
when /6\./
|
||||
it_behaves_like 'basic_setup',
|
||||
["pacemaker","pcs","fence-agents","cman"],
|
||||
false
|
||||
when /7\./
|
||||
it_behaves_like 'basic_setup',
|
||||
["pacemaker","pcs","fence-agents-all","pacemaker-libs"],
|
||||
true
|
||||
shared_examples 'pacemaker' do
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) do
|
||||
facts
|
||||
end
|
||||
it { is_expected.to compile }
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
it { is_expected.to contain_class('pacemaker::install') }
|
||||
it { is_expected.to contain_class('pacemaker::service') }
|
||||
|
||||
case facts[:operatingsystemrelease]
|
||||
when /6\./
|
||||
it_behaves_like 'basic_setup',
|
||||
["pacemaker","pcs","fence-agents","cman"],
|
||||
false
|
||||
when /7\./
|
||||
it_behaves_like 'basic_setup',
|
||||
["pacemaker","pcs","fence-agents-all","pacemaker-libs"],
|
||||
true
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
130
tests/init.pp
130
tests/init.pp
@@ -8,100 +8,100 @@
|
||||
#
|
||||
# Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html
|
||||
#
|
||||
include pacemaker
|
||||
include ::pacemaker
|
||||
|
||||
|
||||
### Installs Pacemaker and corosync and creates a cluster
|
||||
### Should be run on all pacemaker nodes
|
||||
class {"pacemaker::corosync":
|
||||
cluster_name => "cluster_name",
|
||||
cluster_members => "clu-host-1 clu-host-2 clu-host-3",
|
||||
class {'::pacemaker::corosync':
|
||||
cluster_name => 'cluster_name',
|
||||
cluster_members => 'clu-host-1 clu-host-2 clu-host-3',
|
||||
}
|
||||
|
||||
### Disable stonith
|
||||
class {"pacemaker::stonith":
|
||||
class {'::pacemaker::stonith':
|
||||
disable => true,
|
||||
}
|
||||
|
||||
### Add a stonith device
|
||||
class {"pacemaker::stonith::ipmilan":
|
||||
address => "10.10.10.100",
|
||||
username => "admin",
|
||||
password => "admin",
|
||||
class {'::pacemaker::stonith::fence_ipmilan':
|
||||
ipaddr => '10.10.10.100',
|
||||
login => 'admin',
|
||||
passwd => 'admin',
|
||||
}
|
||||
|
||||
pacemaker::resource::ip {"ip-192.168.201.59":
|
||||
ip_address => '192.168.201.59',
|
||||
nic => 'eth3',
|
||||
cidr_netmask => '',
|
||||
pacemaker::resource::ip {'ip-192.168.201.59':
|
||||
ip_address => '192.168.201.59',
|
||||
nic => 'eth3',
|
||||
cidr_netmask => '',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pacemaker::resource::ip {"ip-192.168.201.58":
|
||||
ip_address => '192.168.201.58',
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
pacemaker::resource::ip {'ip-192.168.201.58':
|
||||
ip_address => '192.168.201.58',
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
post_success_sleep => 0,
|
||||
}
|
||||
|
||||
pacemaker::resource::filesystem{ "fs-varlibglanceimages":
|
||||
device => '192.168.200.100:/mnt/glance',
|
||||
directory => '/var/lib/glance/images/',
|
||||
fsoptions => '',
|
||||
fstype => 'nfs',
|
||||
clone_params => '',
|
||||
op_params => 'monitor interval=30s',
|
||||
pacemaker::resource::filesystem{ 'fs-varlibglanceimages':
|
||||
device => '192.168.200.100:/mnt/glance',
|
||||
directory => '/var/lib/glance/images/',
|
||||
fsoptions => '',
|
||||
fstype => 'nfs',
|
||||
clone_params => '',
|
||||
op_params => 'monitor interval=30s',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pacemaker::resource::service {"lb-haproxy":
|
||||
service_name => 'haproxy',
|
||||
op_params => 'monitor start-delay=10s',
|
||||
clone_params => '',
|
||||
pacemaker::resource::service {'lb-haproxy':
|
||||
service_name => 'haproxy',
|
||||
op_params => 'monitor start-delay=10s',
|
||||
clone_params => '',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pacemaker::resource::service {"cinder-api":
|
||||
service_name => 'openstack-cinder-api',
|
||||
clone_params => 'interleave=true',
|
||||
pacemaker::resource::service {'cinder-api':
|
||||
service_name => 'openstack-cinder-api',
|
||||
clone_params => 'interleave=true',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pacemaker::resource::ocf {"neutron-scale":
|
||||
ocf_agent_name => 'neutron:NeutronScale',
|
||||
clone_params => 'globally-unique=true clone-max=3 interleave=true',
|
||||
pacemaker::resource::ocf {'neutron-scale':
|
||||
ocf_agent_name => 'neutron:NeutronScale',
|
||||
clone_params => 'globally-unique=true clone-max=3 interleave=true',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pcmk_resource { "galera":
|
||||
resource_type => "galera",
|
||||
resource_params => 'enable_creation=true wsrep_cluster_address="gcomm://pcmk-c1a1,pcmk-c1a2,pcmk-c1a3"',
|
||||
meta_params => "master-max=3 ordered=true",
|
||||
op_params => 'promote timeout=300s on-fail=block',
|
||||
master_params => '',
|
||||
pcmk_resource { 'galera':
|
||||
resource_type => 'galera',
|
||||
resource_params => 'enable_creation=true wsrep_cluster_address="gcomm://pcmk-c1a1,pcmk-c1a2,pcmk-c1a3"',
|
||||
meta_params => 'master-max=3 ordered=true',
|
||||
op_params => 'promote timeout=300s on-fail=block',
|
||||
master_params => '',
|
||||
post_success_sleep => 0,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
### Add constraints
|
||||
pacemaker::constraint::base { "ip-192.168.122.223_with_fs-mnt":
|
||||
pacemaker::constraint::base { 'ip-192.168.122.223_with_fs-mnt':
|
||||
constraint_type => 'colocation',
|
||||
first_resource => 'ip-192.168.122.223',
|
||||
second_resource => 'fs-mnt',
|
||||
}
|
||||
|
||||
pacemaker::constraint::base { "ip-192.168.122.223_before_fs-mnt":
|
||||
pacemaker::constraint::base { 'ip-192.168.122.223_before_fs-mnt':
|
||||
constraint_type => 'order',
|
||||
first_resource => 'ip-192.168.122.223',
|
||||
second_resource => 'fs-mnt',
|
||||
@@ -109,7 +109,7 @@ pacemaker::constraint::base { "ip-192.168.122.223_before_fs-mnt":
|
||||
second_action => 'start',
|
||||
}
|
||||
|
||||
pacemaker::constraint::base { "ip-192.168.122.223_on_192.168.122.3":
|
||||
pacemaker::constraint::base { 'ip-192.168.122.223_on_192.168.122.3':
|
||||
constraint_type => 'location',
|
||||
first_resource => 'ip-192.168.122.223',
|
||||
location => '192.168.122.3',
|
||||
@@ -118,17 +118,17 @@ pacemaker::constraint::base { "ip-192.168.122.223_on_192.168.122.3":
|
||||
|
||||
### Add properties
|
||||
pacemaker::property { 'global-bar':
|
||||
property => 'bar',
|
||||
value => 'baz',
|
||||
force => true,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
property => 'bar',
|
||||
value => 'baz',
|
||||
force => true,
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
pacemaker::property { 'node-foo':
|
||||
property => 'foo',
|
||||
value => 'baz',
|
||||
node => 'cluster1',
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
property => 'foo',
|
||||
value => 'baz',
|
||||
node => 'cluster1',
|
||||
tries => 1,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user