Skip to content

Commit

Permalink
vrrp::instance: track_script: Add datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 12, 2024
1 parent 22d156a commit 4307d70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1195,11 +1195,11 @@ Default value: `undef`

##### <a name="-keepalived--vrrp--instance--track_script"></a>`track_script`

Data type: `Any`
Data type: `Variant[Array[String[1]],String[1]]`

Define which script to run to track service states.

Default value: `undef`
Default value: `[]`

##### <a name="-keepalived--vrrp--instance--track_process"></a>`track_process`

Expand Down
2 changes: 1 addition & 1 deletion manifests/vrrp/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
$virtual_ipaddress = undef,
$auth_type = undef,
Optional[Variant[String, Sensitive[String]]] $auth_pass = undef,
$track_script = undef,
Variant[Array[String[1]],String[1]] $track_script = [],
Array[String[1]] $track_process = [],
Array[String[1]] $track_file = [],
Array[String[1]] $vrrp_track_file = [],
Expand Down
4 changes: 2 additions & 2 deletions templates/vrrp_instance.erb
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ vrrp_instance <%= @_name %> {
auth_pass <%= @auth_pass_unsensitive %>
}
<%- end -%>
<%- if @track_script -%>
<%- unless @track_script.empty? -%>

track_script {
<%- Array(@track_script).each do |track| -%>
<%- @track_script.each do |track| -%>
<%= track %>
<%- end -%>
}
Expand Down

1 comment on commit 4307d70

@cocker-cc
Copy link
Contributor

@cocker-cc cocker-cc commented on 4307d70 Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When providing a String to

Variant[Array[String[1]],String[1]] $track_script = [],

the ERB fails in Line

<%- @track_script.each do |track| -%>

with

undefined method `each' for "my_track_script":String

This is a breaking Change!

Please sign in to comment.