Hi,

Yet another newbie question .. I'd appreciate any good references, too!

I'm creating a class for managing users, and defining "my_user" as a
convenience function that I've seen in many patterns. I'd like it to manage
passwords if one is supplied to the function.

class users::virtual {
  define ssh_user($passwd, $key) {
    user { $name:
      ensure => present,
      managehome => true,
      if $passwd != '' {
         password = $passwd
      }
    }

  # more code here
}


I get an syntax error on the "if" statement when I run the agent:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Syntax error at 'passwd'; expected '}' at <FILE>.pp:17 on node <FQDN>

Thinking it was a scoping error I've tried various combinations to
qualify the "passwd" parameter but nothing seems to have helped.

Any guidance would be appreciated.

Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to