Fix reconnect_interval parameter

There is a typo in the logic around reconnect_intervl
which makes it skip setting the interval.

Let's fix that by making the code more explicit.
Tested with a custom reconnect interval set via:
ExtraConfig:
  pacemaker_remote_reconnect_interval: 120

And obtained the correct state of the remote resource:
[root@controller-0 ~]# pcs resource show compute-0 |grep reconnect
  Attributes: reconnect_interval=120 server=172.17.1.14

Before the fix there would be no reconnect_interval
attribute.

Change-Id: I5af578b5b838deec7beb2d5a9bb83fa6bb6293b7
Related-Bug: #1797041
This commit is contained in:
Michele Baldessari 2018-10-10 12:43:27 +02:00
parent 9a4bc2d358
commit ece92d13af
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ Puppet::Type.type(:pcmk_resource).provide(:default) do
# Build the 'pcs resource create' command. Check out the pcs man page :-)
cmd = 'resource create ' + @resource[:name]+' ' +@resource[:resource_type]
if @resource[:resource_type] == 'remote'
@resource[:remote_address] ? cmd += ' server=' + @resource[:remote_address] :
if not_empty_string(@resource[:remote_address])
cmd += ' server=' + @resource[:remote_address]
end
# reconnect_interval always has a default
cmd += " reconnect_interval=#{@resource[:reconnect_interval]}"
end
if not_empty_string(resource_params)