Browse Source

Added a states parameter to the user object and rendering of it to the ERB template.

Nick Chappell 9 years ago
parent
commit
d5fa1e655a
2 changed files with 4 additions and 5 deletions
  1. 1 2
      manifests/object/user.pp
  2. 3 3
      templates/object_user.conf.erb

+ 1 - 2
manifests/object/user.pp

@@ -19,8 +19,7 @@ define icinga2::object::user (
   $enable_notifications = undef,
   $period = undef,
   $types = [],
-  #Parameters to add:
-  # states
+  $states = [],
   $target_dir = '/etc/icinga2/conf.d',
   $target_file_name = "${fqdn}.conf",
   $target_file_owner = 'root',

+ 3 - 3
templates/object_user.conf.erb

@@ -10,9 +10,6 @@
  *
  */
 
-//Parameters to add:
-// states
-
 object User "<%= @object_username %>" {
   <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
   <%- if @template_to_import -%>
@@ -45,4 +42,7 @@ object User "<%= @object_username %>" {
   <%- if @types.length != 0 -%>
   types = [ <%- @types.each do |type| -%> <%= type %>, <%- end -%>]
   <%- end -%>
+  <%- if @states.length != 0 -%>
+  states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>]
+  <%- end -%>
 }