Trying to set up a puppet module that runs through most of my samba/
domain joining steps.  I have an exec statement where I run my "net
ads join -U <administrator>%<password>" command.  I would like to
include an additional test statement where the command runs only if it
hasn't already been joined to the domain yet; however, I cannot figure
out how to syntactically use the test command so it works.  The exec I
was trying to use looks like:

exec {
     path => "/usr/bin",
     onlyif => 'test `net ads testjoin 2>&1 | grep Join | sed -e \'s/
*Join is OK*/1/g\' -ne 1'
     command => 'net ads join -U <administrator>%<password>
createcomputer="Samba"
}

The onlyif doesn't work if the result of the testjoin returns "Join is
OK", depending on the test syntax, it just runs or doesnt regardless.
There has to be a better way to do this... anyone with experience
setting this up that cares to share?  Anyone try using the
"refreshonly" option somehow?  Again, my goal here is just for the net
ads join to run when the server is NOT joined to the domain (which
should be rarely).  Thanks

-- 
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.

Reply via email to