To manage Asterisk users, I've made a define that can be used like this: asterisk::user { "sip.login": fullname => "Sip Extension 223", secret => "allyourbase", extension => "223", }
I'm trying to put user definitions in a single string, and make something like the following. Should I go down this way, or should I use a template that takes the array and creates all users in one go? $users = [ "223 sip.login allyourbase Sip Extension 223" ] $users.split().each do |userspec| spec = userspec.split() asterisk::user { spec[1]: full => spec[4..42], secret => spec[2], extension => spec[0], } end Please forgive my lack of Ruby-fu, I'm still making baby-steps. Thank you, -- Luis Bruno --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---