FAQ
I sort of "need" to do this to run a Makefile that uses local directories...

--
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/-/NWcJKsG5-SYJ.
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 6, 2012 at 5:33 am
    Specifically, when I have "cd" in command => ".." it says it cannot find
    the command "cd".
    On Thursday, July 5, 2012 10:31:38 PM UTC-7, Benjamin Lei wrote:

    I sort of "need" to do this to run a Makefile that uses local
    directories...
    --
    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/-/bE3G2xpCy_gJ.
    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.
  • Hendrik Jäger at Jul 6, 2012 at 7:10 am
    Hi,

    On Thu, 5 Jul 2012 22:33:00 -0700 (PDT)
    Benjamin Lei wrote:
    Specifically, when I have "cd" in command => ".." it says it cannot
    find the command "cd".
    Because it is a builtin command in the shell. Either let a shell
    execute your command or use the pwd (or cwd?) parameter.

    Best regards

    Hendrik Jäger
  • Jcbollinger at Jul 6, 2012 at 3:44 pm

    On Friday, July 6, 2012 2:10:13 AM UTC-5, Hendrik Jäger wrote:
    [...] let a shell
    execute your command [...]
    Which you can do fairly easily by adding "provider => 'sh'" to your Exec's
    parameters.

    Or if you need a non-default shell or you just like doing things the hard
    way, then you can use a variation on

    bash -c 'my command here'

    as your command.


    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/-/bS6ih5Uij6sJ.
    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.
  • Stefan Schulte at Jul 7, 2012 at 3:05 pm

    On Fri, Jul 06, 2012 at 08:44:51AM -0700, jcbollinger wrote:

    On Friday, July 6, 2012 2:10:13 AM UTC-5, Hendrik Jäger wrote:

    [...] let a shell
    execute your command [...]
    Which you can do fairly easily by adding "provider => 'sh'" to your Exec's
    parameters.

    Or if you need a non-default shell or you just like doing things the hard
    way, then you can use a variation on

    bash -c 'my command here'

    as your command.
    Instead of doing these kinds of work-arounds I'd just use the cwd
    parameter of the exec resource as described in the type reference [1]

    so e.g.

    exec { 'make_sendmail':
    command => '/usr/bin/make',
    cwd => '/etc/mail'
    }

    If you have GNU make you can also ask the make command itself to change
    the directory (-C dir, --directory=dir)

    [1] http://docs.puppetlabs.com/references/latest/type.html#exec

    -Stefan

    --
    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 6, '12 at 5:31a
activeJul 7, '12 at 3:05p
posts5
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase