2009/5/7 Jeremy Hansen <jer...@skidrow.la>: > > > I'm new to puppet. I'm trying to use some real case examples to better > understand how Puppet works. > > Here's my case: > > exec { "usermod -d /home/hadoop -s /bin/bash hadoop": > unless => "test `grep ^hadoop /etc/passwd | awk -F: '{print > $6}'` == '/home/hadoop'" > } > > The idea is the usermod would only get executed if the user's home > directory was something other then /home/hadoop. But I see in the > client logs that regardless of the condition, the usermod command gets > run each and every time. > > Any tips on what I'm doing wrong? > > Thanks! > -jeremy >
Well, you might want to use the user type: user { "hadoop": home => "/home/hadoop", } Though more generally it would be interesting to know why that test is failing even if the user's homedir is set correctly. Which version of puppet are you using? I assume you've run that command on the command line and gotten the correct exit value? .r' --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---