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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.