Bug 1118824

Summary: Support Puppet environmentpath and environment config files
Product: Red Hat Satellite 6 Reporter: Bryan Kearney <bkearney>
Component: CapsuleAssignee: Dominic Cleal <dcleal>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: jmontleo, ohadlevy
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/4699
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:26:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Bryan Kearney 2014-07-11 15:41:31 UTC
Puppet 3.5 added support for an environmentpath (very much like our own default /etc/puppet/environments/) and 3.6 adds an environment.conf to configure the modulepath etc within each environment.  The proxy should understand these layouts.

https://groups.google.com/d/msg/puppet-dev/2QDi2ThnRJQ/EWrFJXa92i8J
https://tickets.puppetlabs.com/browse/PUP-1596

Comment 1 Bryan Kearney 2014-07-11 15:41:32 UTC
Created from redmine issue http://projects.theforeman.org/issues/4699

Comment 2 Bryan Kearney 2014-07-11 15:41:34 UTC
Upstream bug assigned to dcleal@redhat.com

Comment 4 Bryan Kearney 2014-07-23 14:04:22 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/4699 has been closed
-------------
Dominic Cleal
https://github.com/theforeman/smart-proxy/pull/168
-------------
Dominic Cleal
For anybody wanting to test this on 1.5, here's a rebased patch - please back up your proxy config before using, it's new!  This queries Puppet's v2.0 API on localhost to fetch the list of environments, and defaults to the usual hostname and certificate locations, so hopefully it'll work out of the box for most people - unusual setups may need to change settings.yml, see the example.

https://github.com/domcleal/smart-proxy/compare/theforeman:1.5-stable...4699-environmentpath-15.patch
-------------
Jason Smith
Dominic Cleal wrote:
> For anybody wanting to test this on 1.5, here's a rebased patch - please back up your proxy config before using, it's new!  This queries Puppet's v2.0 API on localhost to fetch the list of environments, and defaults to the usual hostname and certificate locations, so hopefully it'll work out of the box for most people - unusual setups may need to change settings.yml, see the example.
> 
> https://github.com/domcleal/smart-proxy/compare/theforeman:1.5-stable...4699-environmentpath-15.patch

I applied this patch to our test puppet server, with foreman-proxy-1.5.1 & puppet-server-3.6.2 installed and environmentpath set to $confdir/environments, it appears to work perfectly. Tested by running "ruby193-rake RAILS_ENV=production puppet:import:puppet_classes" on the Foreman server. Thanks!
-------------
Evgeny Vasilchenko
Dominic Cleal wrote:
> For anybody wanting to test this on 1.5, here's a rebased patch - please back up your proxy config before using, it's new!  This queries Puppet's v2.0 API on localhost to fetch the list of environments, and defaults to the usual hostname and certificate locations, so hopefully it'll work out of the box for most people - unusual setups may need to change settings.yml, see the example.
> 
> https://github.com/domcleal/smart-proxy/compare/theforeman:1.5-stable...4699-environmentpath-15.patch

The patch worked fine for me: Ubuntu 12.04.04 LTS, x86_64, Puppet 3.6.2, Foreman 1.5.1 (upgraded from 1.5.0)

cd /usr/share/foreman-proxy
curl https://github.com/domcleal/smart-proxy/compare/theforeman:1.5-stable...4699-environmentpath-15.patch | patch -p1

It gives an error about patching files in tests/ but it can be ignored...
I can import Puppet modules and environments now.

-------- /etc/puppet.conf --------
[main]
...
### Enable Directory Environemnts
    environmentpath = $confdir/environments
    basemodulepath = $confdir/modules:/usr/share/puppet/modules

-------- /etc/puppet.conf --------

Thank you very much! 
-------------
Dominic Cleal
Applied in changeset commit:16db7a9c74abfba21b65d9f0e9a05096c3c7f8fb.

Comment 6 Bryan Kearney 2014-09-11 12:26:14 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.