On Mar 13, 2014, at 2:33 PM, Philippe Conway <philippe.con...@gmail.com> wrote:

> Hey Guys,
> 
> I am wanting to add certain users to certain hosts. I was thinking of listing 
> it in my users module. Here is an example:
> 
>  user {'llane':
>     if $fqdn = 'node1.example.com' {
>       ensure => present,
>     }else{
>       ensure => absent,
>     }
>     home       => '/home/llane',
>     managehome => true,
>     uid        => '1003',
>     shell      => '/bin/bash',
>     comment    => 'Lois Lane',
>   }
> 
> Basically looking to add Lois Lane to ONLY node1.example.com.
> 
> However Puppet is saying I can't do it because of a syntax error. To me the 
> code looks correct, but I may be just tired and not noticing the error. Any 
> suggestions? Thanks
> 
> - Philippe

You may already be aware that putting node-specific logic in your puppet 
manifests is not a best practice, but I'll help you with the syntax error. Your 
if conditional needs to use '==' to test the fact value, not a single equal 
which is used for assigning values.

--
Peter Bukowinski

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/96E58085-4C33-4EFB-8AEF-1E62511390DF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to