puppet onlyif specified nodes

Posted by Valintinr on Server Fault See other posts from Server Fault or by Valintinr
Published on 2012-05-30T13:38:10Z Indexed on 2012/06/02 10:43 UTC
Read the original article Hit count: 169

Filed under:
|

I'm trying to write a puppet template. I have a puppet-master and a few puppet-agents and they all must be divided. I think it's good to do this by the node's hostname. But when I tried to do this I've encountered an error

"puppet-agent[169037]: (/Stage[main]//Exec[adduser]) Could not evaluate: Could not find command 'ru1'"

see code below

exec { 'adduser': 
        command => 'sudo adduser -m -p pawSfQewWrUAA test -G wheel',
        path => [ '/bin','/usr/bin' ],
        onlyif => "$hostname == ru1"
}

I need to specify this task for only one node with the hostname ru1. So have can I do this? Thanks.

© Server Fault or respective owner

Related posts about linux

Related posts about puppet