FAQ
Binaries like curl and test must be fully qualified (ex. /bin/rm) or you
must pass the path attribute to your exec resource with a search path like
'/bin:/usr/bin' as the value.

HTH, --Ryan
On Monday, July 2, 2012, Benjamin Lei wrote:

Here's what I'm using:
exec { "cert-fix":
command => "curl http://curl.haxx.se/ca/cacert.pem -o
/etc/pki/tls/certs/ca-bundle.crt",
onlyif => "test -e /etc/pki/tls/certs/ca-bundle.crt",
}

But it keeps on failing:
[default] Running Puppet with /tmp/vagrant-puppet/manifests/acid.pp...
Parameter onlyif failed: 'test -e /etc/pki/tls/certs/ca-bundle.crt' is
both unqu
alifed and specified no search path at
/tmp/vagrant-puppet/manifests/acid.pp:23

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

I am trying to make that exec run the command if the file for it does not
exist yet.
What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/5XjljtHXxCAJ.
To post to this group, send email to puppet-users@googlegroups.com<javascript:_e({}, 'cvml', 'puppet-users@googlegroups.com');>
.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com <javascript:_e({}, 'cvml',
'puppet-users%2Bunsubscribe@googlegroups.com');>.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.

--
Ryan Coleman | about.me/ryc
Modules & Forge @ Puppet Labs

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

Search Discussions

  • Benjamin Lei at Jul 3, 2012 at 4:54 am
    So fully qualified means I need to add in a path to the command I'm trying
    to execute (i.e. test/grep)?
    On Monday, July 2, 2012 9:14:25 PM UTC-7, Ryan Coleman wrote:

    Binaries like curl and test must be fully qualified (ex. /bin/rm) or you
    must pass the path attribute to your exec resource with a search path like
    '/bin:/usr/bin' as the value.

    HTH, --Ryan
    On Monday, July 2, 2012, Benjamin Lei wrote:

    Here's what I'm using:
    exec { "cert-fix":
    command => "curl http://curl.haxx.se/ca/cacert.pem -o
    /etc/pki/tls/certs/ca-bundle.crt",
    onlyif => "test -e /etc/pki/tls/certs/ca-bundle.crt",
    }

    But it keeps on failing:
    [default] Running Puppet with /tmp/vagrant-puppet/manifests/acid.pp...
    Parameter onlyif failed: 'test -e /etc/pki/tls/certs/ca-bundle.crt' is
    both unqu
    alifed and specified no search path at
    /tmp/vagrant-puppet/manifests/acid.pp:23

    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!

    I am trying to make that exec run the command if the file for it does not
    exist yet.
    What am I doing wrong?

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/5XjljtHXxCAJ.
    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.

    --
    Ryan Coleman | about.me/ryc
    Modules & Forge @ Puppet Labs
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/ocGCHl0Q5VsJ.
    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.
  • Ryan Coleman at Jul 3, 2012 at 4:55 am

    On Monday, July 2, 2012, Benjamin Lei wrote:

    So fully qualified means I need to add in a path to the command I'm trying
    to execute (i.e. test/grep)?

    Yep. The command should execute at that point. :-)
    On Monday, July 2, 2012 9:14:25 PM UTC-7, Ryan Coleman wrote:

    Binaries like curl and test must be fully qualified (ex. /bin/rm) or you
    must pass the path attribute to your exec resource with a search path like
    '/bin:/usr/bin' as the value.

    HTH, --Ryan
    On Monday, July 2, 2012, Benjamin Lei wrote:

    Here's what I'm using:
    exec { "cert-fix":
    command => "curl http://curl.haxx.se/ca/cacert.**pem<http://curl.haxx.se/ca/cacert.pem>-o /etc/pki/tls/certs/ca-bundle.
    **crt",
    onlyif => "test -e /etc/pki/tls/certs/ca-bundle.**crt",
    }

    But it keeps on failing:
    [default] Running Puppet with /tmp/vagrant-puppet/manifests/**
    acid.pp...
    Parameter onlyif failed: 'test -e /etc/pki/tls/certs/ca-bundle.**crt'
    is both unqu
    alifed and specified no search path at /tmp/vagrant-puppet/manifests/**
    acid.pp:23

    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!

    I am trying to make that exec run the command if the file for it does
    not exist yet.
    What am I doing wrong?

    --
    You received this message because you are subscribed to the Google
    Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/puppet-users/-/**5XjljtHXxCAJ<https://groups.google.com/d/msg/puppet-users/-/5XjljtHXxCAJ>
    .
    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<http://groups.google.com/group/puppet-users?hl=en>
    .

    --
    Ryan Coleman | about.me/ryc
    Modules & Forge @ Puppet Labs
    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/ocGCHl0Q5VsJ.
    To post to this group, send email to puppet-users@googlegroups.com<javascript:_e({}, 'cvml', 'puppet-users@googlegroups.com');>
    .
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@googlegroups.com <javascript:_e({}, 'cvml',
    'puppet-users%2Bunsubscribe@googlegroups.com');>.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.

    --
    Ryan Coleman | about.me/ryc
    Modules & Forge @ Puppet Labs

    --
    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.
  • Benjamin Lei at Jul 3, 2012 at 5:00 am
    Here's what I'm using:
    exec { "cert-fix":
    command => "curl http://curl.haxx.se/ca/cacert.pem -o
    /etc/pki/tls/certs/ca-bundle.crt",
    onlyif => "test -e /etc/pki/tls/certs/ca-bundle.crt",
    }

    But it keeps on failing:
    [default] Running Puppet with /tmp/vagrant-puppet/manifests/acid.pp...
    Parameter onlyif failed: 'test -e /etc/pki/tls/certs/ca-bundle.crt' is
    both unqu
    alifed and specified no search path at
    /tmp/vagrant-puppet/manifests/acid.pp:23

    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!

    I am trying to make that exec run the command if the file for it does not
    exist yet.
    What am I doing wrong?

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/5XjljtHXxCAJ.
    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.
  • Ad at Jul 5, 2012 at 2:21 pm
    fwiw, I put this at the top of my global site.pp (one of 3 lines in
    the file).

    # Globally set exec path so we don't have to specify it each time we
    use exec.
    Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }

    hth,

    Adam

    --
    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.
  • Jcbollinger at Jul 3, 2012 at 1:15 pm

    On Monday, July 2, 2012 11:14:25 PM UTC-5, Ryan Coleman wrote:
    Binaries like curl and test must be fully qualified (ex. /bin/rm) or you
    must pass the path attribute to your exec resource with a search path like
    '/bin:/usr/bin' as the value.


    Or you can set a path via Exec's 'path' parameter. Sometimes that's more
    convenient and / or clearer.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/CV5sPyIiDScJ.
    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.
  • Felix Frank at Jul 5, 2012 at 8:18 am

    On 07/03/2012 03:15 PM, jcbollinger wrote:
    On Monday, July 2, 2012 11:14:25 PM UTC-5, Ryan Coleman wrote:

    Binaries like curl and test must be fully qualified (ex. /bin/rm) or
    you must pass the path attribute to your exec resource with a search
    path like '/bin:/usr/bin' as the value.



    Or you can set a path via Exec's 'path' parameter. Sometimes that's
    more convenient and / or clearer.
    It's also safer. Some badly written scripts won't work unless invoked
    with a valid PATH environment variable.

    Cheers,
    Felix

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 3, '12 at 4:14a
activeJul 5, '12 at 2:21p
posts7
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase