We're running 2.6 on Ubuntu 10.04 and here's what I'm seeing (simplified test):
class cdtest {
exec {'cdtest': command => 'cd' }
}
# puppet agent --test
info: Caching catalog for servername
info: Applying configuration version '1280441519'
err: /Stage[main]/Cdtest/Exec[cdtest]/returns: change from notrun to 0 failed: Could not find command 'cd'
notice: Finished catalog run in 0.65 seconds
#
Any ideas on why this is failing? I am running into this with rvm as well (since it is a function and not a binary).
Thanks!
Greg Graf
Systems Engineer
Rackspace
Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at ab...@rackspace.com, and delete the original message.
Your cooperation is appreciated.
I saw the same thing happen with a few for-loops and had to wrap them
up in /bin/sh -c '...' for 2.6. Now that I look for it, I can't find
anything about this behavior change in the release notes for 2.6. Was
it coincidental that it ever worked?
Isn't this by design? Unless the puppet docs say that "exec" is always
run through a shell, then I wouldn't expect it to be.
In my manifests, if I want a shell, I explicitly use:
command => '/bin/sh -c "some shell commands"'
--
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia
See:
http://projects.puppetlabs.com/issues/4288
http://projects.puppetlabs.com/issues/4299
For some history and comments on this. We'd welcome some input into
what you think should be safe and expected behaviour here.
Cheers
James Turnbull
--
Puppet Labs - http://www.puppetlabs.com
C: 503-734-8571
[...]
>> I saw the same thing happen with a few for-loops and had to wrap them
>> up in /bin/sh -c '...' for 2.6. Now that I look for it, I can't find
>> anything about this behavior change in the release notes for 2.6. Was
>> it coincidental that it ever worked?
>
> See:
>
> http://projects.puppetlabs.com/issues/4288
> http://projects.puppetlabs.com/issues/4299
>
> For some history and comments on this. We'd welcome some input into
> what you think should be safe and expected behaviour here.
If this is a "voting" matter, let me put in a vote for passing a simple string
to the shell, and passing an array direct to exec, which is consistent with
the use of 'system' style commands in a whole bunch of sysadmin scripting
languages.
Eg, this:
exec { "foo": command => ['/bin/ls', '|' 'foo'] }
will pass '|' 'foo' to the ls command, compared to:
exec { "foo": command => "/bin/ls | foo" }
...which passes it to the default system shell.
Daniel
--
✣ Daniel Pittman ✉ dan...@rimspace.net ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
--
dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at
Klosterneuburg UID: ATU64260999
FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg
+1 [I added a missing comma above.]
--apb (Alan Barrett)
> If this is a "voting" matter, let me put in a vote for passing a simple string
> to the shell, and passing an array direct to exec, which is consistent with
> the use of 'system' style commands in a whole bunch of sysadmin scripting
> languages.
>
> Eg, this:
>
> exec { "foo": command => ['/bin/ls', '|' 'foo'] }
>
> will pass '|' 'foo' to the ls command, compared to:
>
> exec { "foo": command => "/bin/ls | foo" }
>
> ...which passes it to the default system shell.
I think this is a very reasonable suggestion, so +1 from me as well.
But I'd like to point out the shellquote() function, which can give you
the semantics of the first version already today:
exec { "foo": command => shellquote("/bin/ls", "|", "foo"); }
(There's actually a slight difference. Using shellquote() today will
give you an intermediate shell process, making it somewhat less efficient.)
/Bellman
--
Joe McDonagh
AIM: YoosingYoonickz
IRC: joe-mac on freenode
"When the going gets weird, the weird turn pro."
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Any chance you could throw your solution on the ticket and I'll start a
discussion about it internally.
Thanks
James
Most of the work is already done by ruby's Kernel.exec() function;
puppet would simply need the ability to pass an array all the way
through to the underlying ruby function.
--apb (Alan Barrett)
> Any chance you could throw your solution on the ticket and I'll start a
> discussion about it internally.
Um, sure. Let me go dig out the details (eg: ticket url) and all.