Hi there,

i want to create a user. The name of the user is based on the
hostname. If my hostname is ,,notebook12'', my user is ,,user12''.

The idea is to replace ,,notebook'' with ,,user'' and create fact
called ,,username''.

But my fact doesn't work:

Facter.add("username") do
  setcode do
    $username = Facter.hostname
    $username.sub!(/notebook/, 'user')
    puts $username
  end
end

I suspect the problem is in the third line ;).

Any help is greatly appreciated.

MFG,

Karsten

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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.

Reply via email to