Martin Harrigan
2011-Jan-11 14:36 UTC
[Puppet Users] Differences between puppet and puppetd
Hi all,
I am using Puppet to execute an Expect script (http://expect.sourceforge.net)
on a client. The Puppet recipe, test.pp, is:
exec { ''/root/test.exp'':
command => ''/root/test.exp'',
logoutput => true
}
The recipe runs correctly when run using ''puppet --debug --verbose
test.pp'':
debug: /Stage[main]//Exec[/root/test.exp]: Executing
''/root/test.exp''
debug: Executing ''/root/test.exp''
notice: /Stage[main]//Exec[/root/test.exp]/returns: spawn
/etc/ssl/misc/CA.pl -newca
...
notice: /Stage[main]//Exec[/root/test.exp]/returns: executed successfully
However, it fails when run using puppetd:
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
spawn /etc/ssl/misc/CA.pl -newca#015
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
#015
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
send: spawn id exp3 not open
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
while executing
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
"send "password\r""
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
(file "/root/test.exp" line 9)#015
... puppet-agent[3650]: (/Stage[main]/Mail/Exec[/root/test.exp]/returns)
change from notrun to 0 failed: /root/test.exp returned 1 instead of one of
[0] at ...
Is there any difference in the way Puppet executes a recipe using
''puppet
--debug --verbose'' compared to using puppetd?
Martin.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Bruce Richardson
2011-Jan-11 15:02 UTC
Re: [Puppet Users] Differences between puppet and puppetd
On Tue, Jan 11, 2011 at 02:36:42PM +0000, Martin Harrigan wrote:> Hi all, > > I am using Puppet to execute an Expect script (http://expect.sourceforge.net) > on a client. The Puppet recipe, test.pp, is: > > exec { ''/root/test.exp'': > command => ''/root/test.exp'', > logoutput => true > } > > > Is there any difference in the way Puppet executes a recipe using ''puppet > --debug --verbose'' compared to using puppetd?One issue will be the path. You really do need to set a path for exec with a minimum of ''/bin/'' on it so that puppetd can find /bin/sh, in my experience. When you run puppet rather than puppetd, it''s inheriting your environment with your path. -- Bruce It is impolite to tell a man who is carrying you on his shoulders that his head smells. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Martin Harrigan
2011-Jan-11 15:28 UTC
Re: [Puppet Users] Differences between puppet and puppetd
Thanks Bruce -- setting both path and cwd fixed the problem. On Tue, Jan 11, 2011 at 3:02 PM, Bruce Richardson <itsbruce@workshy.org>wrote:> On Tue, Jan 11, 2011 at 02:36:42PM +0000, Martin Harrigan wrote: > > Hi all, > > > > I am using Puppet to execute an Expect script ( > http://expect.sourceforge.net) > > on a client. The Puppet recipe, test.pp, is: > > > > exec { ''/root/test.exp'': > > command => ''/root/test.exp'', > > logoutput => true > > } > > > > > > Is there any difference in the way Puppet executes a recipe using ''puppet > > --debug --verbose'' compared to using puppetd? > > One issue will be the path. You really do need to set a path for exec > with a minimum of ''/bin/'' on it so that puppetd can find /bin/sh, in my > experience. When you run puppet rather than puppetd, it''s inheriting > your environment with your path. > > -- > Bruce > > It is impolite to tell a man who is carrying you on his shoulders that > his head smells. > > -- > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.