Skip to content

Commit

Permalink
Added description fields to frontend, backend and listen manifests
Browse files Browse the repository at this point in the history
* Added description field to backend

* Added description field to frontend

* Added description field to listen

* Added description fragment

* Added description logic to backend

* Added description logic to frontend

* Added description logic to listen
  • Loading branch information
LukasAud committed Feb 3, 2022
2 parents 3514ea0 + eb1ca12 commit 92d5912
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/backend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
# The mode of operation for the backend service. Valid values are undef,
# 'tcp', 'http', and 'health'.
#
# @param description
# Allows to add a sentence to describe the related object in the HAProxy HTML
# stats page. The description will be printed on the right of the object name
# it describes. Usefull in huge environments
#
# @param options
# A hash of options that are inserted into the backend configuration block.
#
Expand Down Expand Up @@ -73,6 +78,7 @@
$instance = 'haproxy',
$section_name = $name,
$sort_options_alphabetic = undef,
$description = undef,
$defaults = undef,
Optional[Stdlib::Absolutepath] $config_file = undef,
) {
Expand Down
6 changes: 6 additions & 0 deletions manifests/frontend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
# The mode of operation for the frontend service. Valid values are undef,
# 'tcp', 'http', and 'health'.
#
# @param description
# Allows to add a sentence to describe the related object in the HAProxy HTML
# stats page. The description will be printed on the right of the object name
# it describes. Usefull in huge environments
#
# @param bind_options
# (Deprecated) An array of options to be specified after the bind declaration
# in the listening serivce's configuration block.
Expand Down Expand Up @@ -99,6 +104,7 @@
$instance = 'haproxy',
$section_name = $name,
$sort_options_alphabetic = undef,
$description = undef,
$defaults = undef,
$defaults_use_backend = true,
Optional[Stdlib::Absolutepath] $config_file = undef,
Expand Down
6 changes: 6 additions & 0 deletions manifests/listen.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
# The mode of operation for the listening service. Valid values are undef,
# 'tcp', 'http', and 'health'.
#
# @param description
# Allows to add a sentence to describe the related object in the HAProxy HTML
# stats page. The description will be printed on the right of the object name
# it describes. Usefull in huge environments
#
# @param options
# A hash of options that are inserted into the listening service
# configuration block.
Expand Down Expand Up @@ -103,6 +108,7 @@
$instance = 'haproxy',
$section_name = $name,
$sort_options_alphabetic = undef,
$description = undef,
$defaults = undef,
Optional[Stdlib::Absolutepath] $config_file = undef,
# Deprecated
Expand Down
3 changes: 3 additions & 0 deletions templates/fragments/_description.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% if @description -%>
description <%= @description %>
<% end -%>
1 change: 1 addition & 0 deletions templates/haproxy_backend_block.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

backend <%= @section_name %>
<%= scope.function_template(['haproxy/fragments/_mode.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_description.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_options.erb']) -%>
1 change: 1 addition & 0 deletions templates/haproxy_frontend_block.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
frontend <%= @section_name %>
<%= scope.function_template(['haproxy/fragments/_bind.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_mode.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_description.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_options.erb']) -%>
1 change: 1 addition & 0 deletions templates/haproxy_listen_block.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
listen <%= @section_name %>
<%= scope.function_template(['haproxy/fragments/_bind.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_mode.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_description.erb']) -%>
<%= scope.function_template(['haproxy/fragments/_options.erb']) -%>

0 comments on commit 92d5912

Please sign in to comment.