puppet via apache / passenger

546 views
Skip to first unread message

Tim Dunphy

unread,
Feb 6, 2014, 5:14:05 AM2/6/14
to puppet...@googlegroups.com
Hello puppet,

 I am trying to get puppet to work via apache and passenger and not having much luck.

Here is the error that I am currently seeing:

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Error 405 on SERVER: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL /production/report/puppet.mydomain.com.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at puppet.mydomain
.com Port 8140</address>
</body></html>

I have installed rack and passenger via gems on centos 6.4

passenger (4.0.37)
rack (1.5.2)

I have puppet server and client at the following versions:

puppet-server-3.4.1-1.el6.noarch
puppet-server-3.4.1-1.el6.noarch

This is what I have for my passenger apache configuration:

<VirtualHost *:80>
ServerName puppet.mydomain.com
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37
     PassengerDefaultRuby /usr/bin/ruby
   </IfModule>
# Recommended Passenger Configuration
PassengerHighPerformance on
#PassengerMaxPoolSize control number of application instances,
# typically 1.5x the number of processor cores.
PassengerMaxPoolSize 6
# Restart ruby process after handling specific number of request to resolve MRI memory leak. PassengerMaxRequests 4000
# Shutdown idle Passenger instances after 30 min.
PassengerPoolIdleTime 1800
# End of /etc/httpd/conf.d/10_passenger.conf
</VirtualHost>


This is what I have for my puppetmaster vhost:

Listen 8140
<VirtualHost *:8140>
SSLEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
SSLCertificateFile /etc/puppet/ssl/certs/puppet.mydomain.com.pem
SSLCertificateKeyFile /etc/puppet/ssl/private_keys/puppet.mydomain.com.pem
SSLCertificateChainFile /etc/puppet/ssl/certs/ca.pem
SSLCACertificateFile /etc/puppet/ssl/ca/ca_crt.pem
SSLCARevocationFile /etc/puppet/ssl/ca/ca_crl.pem
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e
DocumentRoot /usr/share/puppet/rack/puppetmasterd/public
<Directory '/usr/share/puppet/rack/puppetmasterd/public'>
Options None
AllowOverride None
Order allow,deny
allow from all
</Directory>


I have verified all directories and files in both confs, and an apache config test gives this setup a thumbs up!

Here is my (minimal) config.ru I am using:

# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)
run Rails.application


I was just wondering if I was doing anything obviously (or not so obviously) wrong or if someone could help me out with this error.

Ultimately, once I am able to get this working I'd like to be able to get get the Foreman working as a web interface for my puppet server (which works really well otherwise).


Thank you,
Tim

--
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

pdpinfo

unread,
Feb 6, 2014, 8:07:42 AM2/6/14
to puppet...@googlegroups.com
Hi,
have you also checked /etc/puppet/auth.conf ?

You should have something like:

path /report
method save
allow *

If it is in place , to troubleshoot try

path /report
# method save
allow *

Regards

Paolo

Tim Dunphy

unread,
Feb 7, 2014, 4:30:35 AM2/7/14
to puppet...@googlegroups.com
Hey all,

 I made a little progress. Turns out that my directory structure under the 'rack' directory may have been contributing to some of the problems I had been facing.

Originally I had

[root@puppet:/etc/puppet] #tree rack/
rack/
    ├── tmp
    ├── public
    └── puppetmasterd
           └── config.ru


 But then I changed it to the following:

[root@puppet:/etc/puppet] #tree rack/
rack/
└── puppetmasterd
    ├── config.ru
    ├── public
    └── tmp
        └── restart.txt

All owned by puppet:puppet.

Then I restarted apache and now the error I get is the following:

[root@puppet:/etc/puppet] #puppet agent --test
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 400 on SERVER: cannot generate tempfile `/var/lib/puppet/yaml/node/puppet.jokefire.com.yaml20140207-22853-vkj608-9'
Info: Loading facts in /etc/puppet/modules/epel/lib/facter/os_maj_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: cannot generate tempfile `/var/lib/puppet/yaml/facts/puppet.jokefire.com.yaml20140207-22853-lv2ym0-9'

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


Which from the output I would think would be incorrect ownership of the /var/lib/puppet/yaml/node and the /var/lib/puppet/yaml/facts directories.

But those directories both have puppet:puppet ownership:

[root@puppet:/etc/puppet] #ls -l /var/lib/puppet | grep yaml | grep -v client
drwxr-x---  5 puppet puppet 4096 Feb  6 23:35 yaml

[root@puppet:/etc/puppet] #ls -l /var/lib/puppet/yaml/ | grep node
drwxr-xr-x 2 puppet puppet 4096 Feb  7 04:06 node


So I could use some help on how to resolve this error.

Enclosing debug output for further reference in case that will help.

Thanks
Tim

puppet_run.dbg

Tim Dunphy

unread,
Feb 7, 2014, 4:52:18 AM2/7/14
to puppet...@googlegroups.com
hey guys,

 got it solved! turns out there was nothing wrong with the way it was configured. Just that the disk had become full. So I cleared some space and it started working.


[root@puppet:/etc/puppet] #puppet agent --test
Info: Loading facts in /etc/puppet/modules/epel/lib/facter/os_maj_version.rb
Info: Caching catalog for puppet.mydomain.com
Info: Applying configuration version '1391766506'
Notice: /Stage[main]/Puppet::Master/Service[puppetmaster]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Puppet::Master/Service[puppetmaster]: Unscheduling refresh on Service[puppetmaster]
Notice: /Stage[main]/Puppet::Service/Service[puppet]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Puppet::Service/Service[puppet]: Unscheduling refresh on Service[puppet]
Notice: Finished catalog run in 8.73 seconds


Thanks,
Tim
Reply all
Reply to author
Forward
0 new messages