Set environment variable that is visible to package installation

779 views
Skip to first unread message

Kevin Lange

unread,
Jun 19, 2013, 1:08:46 PM6/19/13
to puppet...@googlegroups.com
We have RPMs which requires an environment variable to be set prior to installation (contains conf information).  What is the best way to do this?  I'd like to avoid setting this environment var in each systems' profile.  It would be nice to have an option to do this within the package type, but I think that's not very likely.

Nikola Petrov

unread,
Jun 20, 2013, 10:53:38 AM6/20/13
to puppet...@googlegroups.com
You can get the environment variable from puppet.conf or if it is
another variable, you can use facter. As long as you are controlling
your packages you can check those after that.

--
Nikola
> --
> 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...@googlegroups.com.
> To post to this group, send email to puppet...@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Michael Dodwell

unread,
Jun 20, 2013, 8:37:51 PM6/20/13
to puppet...@googlegroups.com
Another method is to use exec {} instead of package {} to install the rpm. This will enable you to set environment => 'BATCH=myval', path => ['/bin', '/usr/bin'] etc

use unless to check if the package is installed so it doesn't try to install it multiple times.
Reply all
Reply to author
Forward
0 new messages