FAQ
I have a script that I execute to run a mono exe during a setup process. I
would like to automate that with puppet but the exe depends on an
environment variable being set or it will fail. My setup.sh file looks
like this.

export MY_ENV_VAR=$HOME/target_dir
/usr/mono/bin/mono $HOME/path_to_exe/Setup.exe

this fails because well $HOME is meaningless in a puppet context. Here's
is what I would like to do.

exec { 'myscript':
         command => "/bin/sh /some_path/scripts/setup.sh",
}

I can't change the mono exe to not rely on special environment variable.
  That isn't an option.

So in summary I need to be able to set a special env variable for the exec
context and I have to be able to dynamically change the path to the exe
because each users home directory will be different. I searched for a
while but now my eyes are just crossed.

Any ideas?


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jcbollinger at Sep 23, 2013 at 3:09 pm

    On Friday, September 20, 2013 3:18:20 PM UTC-5, Derek Strickland wrote:
    I have a script that I execute to run a mono exe during a setup process.
    I would like to automate that with puppet but the exe depends on an
    environment variable being set or it will fail. My setup.sh file looks
    like this.

    export MY_ENV_VAR=$HOME/target_dir
    /usr/mono/bin/mono $HOME/path_to_exe/Setup.exe

    this fails because well $HOME is meaningless in a puppet context. Here's
    is what I would like to do.

    exec { 'myscript':
    command => "/bin/sh /some_path/scripts/setup.sh",
    }

    I can't change the mono exe to not rely on special environment variable.
    That isn't an option.

    So in summary I need to be able to set a special env variable for the exec
    context and I have to be able to dynamically change the path to the exe
    because each users home directory will be different. I searched for a
    while but now my eyes are just crossed.

    Any ideas?
    This is what the "environment" parameter of the Exec resource type is for.


    John


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 20, '13 at 8:27p
activeSep 23, '13 at 3:09p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Derek Strickland: 1 post Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase