Defined Type: pacemaker::stonith::fence_virt

Defined in:
manifests/stonith/fence_virt.pp

Overview

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

action

Fencing action (null, off, on, [reboot], status, list, monitor, metadata)

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 number of tries.

try_sleep

Time to sleep between tries.

pcmk_host_list

List of Pacemaker hosts.

meta_attr

(optional) String of meta attributes Defaults to undef

deep_compare

Enable deep comparing of resources and bundles When set to true a resource will be compared in full (options, meta parameters,..) to the existing one and in case of difference it will be repushed to the CIB Defaults to false

update_settle_secs

When deep_compare is enabled and puppet updates a resource, this parameter represents the number (in seconds) to wait for the cluster to settle after the resource update. Defaults to 600 (seconds)

Dependencies

None

Authors

Generated by rake generate_stonith task.

Copyright © 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.

Parameters:

  • debug (Any) (defaults to: undef)
  • serial_device (Any) (defaults to: undef)
  • serial_params (Any) (defaults to: undef)
  • channel_address (Any) (defaults to: undef)
  • ipport (Any) (defaults to: undef)
  • port (Any) (defaults to: undef)
  • action (Any) (defaults to: undef)
  • timeout (Any) (defaults to: undef)
  • delay (Any) (defaults to: undef)
  • domain (Any) (defaults to: undef)
  • meta_attr (Any) (defaults to: undef)
  • interval (Any) (defaults to: '60s')
  • ensure (Any) (defaults to: present)
  • pcmk_host_list (Any) (defaults to: undef)
  • tries (Any) (defaults to: undef)
  • try_sleep (Any) (defaults to: undef)
  • deep_compare (Any) (defaults to: false)
  • update_settle_secs (Any) (defaults to: 600)


94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'manifests/stonith/fence_virt.pp', line 94

define pacemaker::stonith::fence_virt (
  $debug           = undef,
  $serial_device   = undef,
  $serial_params   = undef,
  $channel_address = undef,
  $ipport          = undef,
  $port            = undef,
  $action          = undef,
  $timeout         = undef,
  $delay           = undef,
  $domain          = undef,

  $meta_attr       = undef,
  $interval        = '60s',
  $ensure          = present,
  $pcmk_host_list  = undef,

  $tries           = undef,
  $try_sleep       = undef,

  $deep_compare       = false,
  $update_settle_secs = 600,
) {
  $debug_chunk = $debug ? {
    undef   => '',
    default => "debug=\"${debug}\"",
  }
  $serial_device_chunk = $serial_device ? {
    undef   => '',
    default => "serial_device=\"${serial_device}\"",
  }
  $serial_params_chunk = $serial_params ? {
    undef   => '',
    default => "serial_params=\"${serial_params}\"",
  }
  $channel_address_chunk = $channel_address ? {
    undef   => '',
    default => "channel_address=\"${channel_address}\"",
  }
  $ipport_chunk = $ipport ? {
    undef   => '',
    default => "ipport=\"${ipport}\"",
  }
  $port_chunk = $port ? {
    undef   => '',
    default => "port=\"${port}\"",
  }
  $action_chunk = $action ? {
    undef   => '',
    default => "action=\"${action}\"",
  }
  $timeout_chunk = $timeout ? {
    undef   => '',
    default => "timeout=\"${timeout}\"",
  }
  $delay_chunk = $delay ? {
    undef   => '',
    default => "delay=\"${delay}\"",
  }
  $domain_chunk = $domain ? {
    undef   => '',
    default => "domain=\"${domain}\"",
  }

  $pcmk_host_value_chunk = $pcmk_host_list ? {
    undef   => '$(/usr/sbin/crm_node -n)',
    default => $pcmk_host_list,
  }

  $meta_attr_value_chunk = $meta_attr ? {
    undef   => '',
    default => "meta ${meta_attr}",
  }

  # $title can be a mac address, remove the colons for pcmk resource name
  $safe_title = regsubst($title, ':', '', 'G')

  Exec<| title == 'wait-for-settle' |> -> Pcmk_stonith<||>

  $param_string = "${debug_chunk} ${serial_device_chunk} ${serial_params_chunk} ${channel_address_chunk} ${ipport_chunk} ${port_chunk} ${action_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk}  op monitor interval=${interval} ${meta_attr_value_chunk}"

  if $ensure != 'absent' {
    ensure_packages('fence-virt', { ensure => 'installed' })
    Package['fence-virt'] -> Pcmk_stonith["stonith-fence_virt-${safe_title}"]
  }
  pcmk_stonith { "stonith-fence_virt-${safe_title}":
    ensure             => $ensure,
    stonith_type       => 'fence_virt',
    pcmk_host_list     => $pcmk_host_value_chunk,
    pcs_param_string   => $param_string,
    tries              => $tries,
    try_sleep          => $try_sleep,
    deep_compare       => $deep_compare,
    update_settle_secs => $update_settle_secs,
  }
}