From 3e21aaa7e897b1409109625be64b1729bf774a2c Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 20 Jun 2015 09:39:07 -0400 Subject: [PATCH] Add support for passing channels as list The list of channels for statusbot can get large and unweildy, making reviewing additions ugly. Accept it as a list. However, because of things using the old interface, support a comma separated string being passed as well. Change-Id: I5adad696707b987f0fee7211b89e340d265d6bd9 --- manifests/init.pp | 2 +- templates/statusbot.config.erb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index a562ba3..864247e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,7 +4,7 @@ class statusbot( $nick = '', $password = '', $server = '', - $channels = '', + $channels = [], $auth_nicks = '', $wiki_user = '', $wiki_password = '', diff --git a/templates/statusbot.config.erb b/templates/statusbot.config.erb index 87743ee..2d5be92 100644 --- a/templates/statusbot.config.erb +++ b/templates/statusbot.config.erb @@ -3,7 +3,11 @@ nick=<%= nick %> pass=<%= password %> server=<%= server %> port=6667 -channels=<%= channels %> +<% if @channels.respond_to?('join') -%> +channels=<%= @channels.join(',') %> +<% else -%> +channels=<%= @channels %> +<% end -%> nicks=<%= auth_nicks %> lockfile=/var/run/statusbot/statusbot.pid log_config=/etc/statusbot/logging.config