Skip to content

Commit

Permalink
Fix datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
alvagante committed Sep 25, 2024
1 parent 47c49b2 commit dff2762
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions manifests/info/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
# }
#
define puppi::info::module (
String $packagename = '',
String $servicename = '',
Array $packagename = [],
Array $servicename = [],
String $processname = '',
String $configfile = '',
Array $configfile = [],
String $configdir = '',
String $initconfigfile = '',
String $pidfile = '',
String $datadir = '',
String $logfile = '',
String $logdir = '',
Array $datadir = [],
Array $logfile = [],
Array $logdir = [],
String $protocol = '',
Variant[String,Integer] $port = '',
String $description = '',
String $run = '',
Array $run = [],
String $verbose = 'no',
String $templatefile = 'puppi/info/module.erb',
) {
Expand Down
14 changes: 7 additions & 7 deletions templates/info/module.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Sources common header for Puppi scripts
. <%= scope.lookupvar('puppi::params::scriptsdir') %>/header || exit 10

<% if @packagename != "" -%>
<% if @packagename != [] -%>
# Show packages info
echo_title "$HOSTNAME - <%= @name %>: Packages Installed: <% @packagename.each do |item| %><%= item %><% end %>"
<% @packagename.each do |item| -%>
Expand All @@ -19,7 +19,7 @@ show_command "<%= scope.lookupvar('puppi::params::info_package_list') %> <%= ite
<% end -%>
<% end -%>

<% if @configfile != "" -%>
<% if @configfile != [] -%>
# Show config info
echo_title "$HOSTNAME - <%= @name %>: Configuration Files managed: <% @configfile.each do |item| %><%= item %><% end %>"
<% @configfile.each do |item| -%>
Expand All @@ -31,7 +31,7 @@ show_command "head <%= item %>"
<% end -%>
<% end -%>

<% if @datadir != "" -%>
<% if @datadir != [] -%>
# Show data dir
echo_title "$HOSTNAME - <%= @name %>: Application data are in: <% @datadir.each do |item| %><%= item %><% end %>"
<% @datadir.each do |item| -%>
Expand All @@ -40,7 +40,7 @@ show_command "df <%= item %>"
<% end -%>
<% end -%>

<% if @logdir != "" -%>
<% if @logdir != [] -%>
# Show log dir
echo_title "$HOSTNAME - <%= @name %>: Logs are in: <% @logdir.each do |item| %><%= item %><% end %>"
<% @logdir.each do |item| -%>
Expand All @@ -49,7 +49,7 @@ show_command "df <%= item %>"
<% end -%>
<% end -%>

<% if @logfile != "" -%>
<% if @logfile != [] -%>
# Show logs
echo_title "$HOSTNAME - <%= @name %>: Last log entries: <% @logfile.each do |item| %><%= item %><% end %>"
<% @logfile.each do |item| -%>
Expand All @@ -61,14 +61,14 @@ show_command "tail -10 <%= item %>"
<% end -%>
<% end -%>

<% if @run != "" -%>
<% if @run != [] -%>
echo_title "$HOSTNAME - <%= @name %>: Extra info"
<% @run.each do |cmd| %>show_command "<%= cmd %>"
<% end -%>
<% end -%>


<% if @servicename != "" -%>
<% if @servicename != [] -%>
# Show service info
echo_title "$HOSTNAME - <%= @name %>: Services: <% @servicename.each do |item| %><%= item %><% end %>"
<% @servicename.each do |item| -%>
Expand Down

0 comments on commit dff2762

Please sign in to comment.