Can't get puppet/passenger to stop using /home/puppet/.puppet

43 views
Skip to first unread message

John Pyeatt

unread,
Apr 10, 2014, 6:21:07 PM4/10/14
to puppet...@googlegroups.com
I've followed all of the documentation at http://docs.puppetlabs.com/guides/passenger.html to try to switch from webrick to passenger/apache.

I'm obviously doing something wrong however because I can't get passenger to use /etc/puppet instead of /home/puppet/.puppet to store data.

Any ideas would be appreciated. Below are some of the details.

I'm running it on Ubuntu 12
I'm using Apache 2.2.22
I'm using puppet 3.4.0
I'm using passenger 4.0.41

1) I've created the directories /usr/share/puppet/rack/puppetmasterd with ./public ./tmp directories

2) In that directory I've put in a config.ru that looks like this:
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.
# if puppet is not in your RUBYLIB:
# $:.unshift('/var/lib/puppet')
$0 = "master"
# if you want debugging:
# ARGV << "--debug"
ARGV << "--rack"
ARGV << "--confdir" << "/etc/puppet"
ARGV << "--vardir"  << "/var/lib/puppet"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run


3) I've created the file /etc/apache2/sites-available/passenger with the following snippet
    DocumentRoot /usr/share/puppet/rack/puppetmasterd/public

    <Directory /usr/share/puppet/rack/puppetmasterd/>
      Options None
      AllowOverride None
      # Apply the right behavior depending on Apache version.
      Order allow,deny
      Allow from all
    </Directory>


No matter what I've tried it still puts everything to /home/puppet/.puppet directory instead of using /etc/puppet





--
John Pyeatt
Singlewire Software, LLC
www.singlewire.com
------------------
608.661.1184
john....@singlewire.com

Spencer Krum

unread,
Apr 10, 2014, 6:30:35 PM4/10/14
to puppet...@googlegroups.com
Does the puppet user have read/execute on all files/dirs under /etc/puppet?

Is the config.ru file owned by the puppet user?


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAEisTLk4w%2BJJN5GvgBz%3DNA8%2BTTcfQ49ZCD0AABdU2E-mCBhQNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Spencer Krum
(619)-980-7820

John Pyeatt

unread,
Apr 11, 2014, 9:35:34 AM4/11/14
to puppet...@googlegroups.com
Yes. puppet has those permissions.
I even tried doing

chown -R puppet:puppet /etc/puppet
and
chown -R puppet:puppet /usr/share/puppet





For more options, visit https://groups.google.com/d/optout.



--

John Pyeatt

unread,
Apr 11, 2014, 10:15:08 AM4/11/14
to puppet...@googlegroups.com
Added info.

When I look in /var/log/syslog I see the line
puppet-master[26751]: Using settings: adding file resource 'confdir': 'File[/home/puppet/.puppet]{:ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false, :path=>"/home/puppet/.puppet"}'

My config.ru file contains the line

ARGV << "--confdir" << "/etc/puppet"

but it appears to me that my directive is being ignored.

Since syslog is indicating the creation of /home/puppet.puppet for confdir it is as if either my config.ru file isn't being read, or the --confdir argument in config.ru is being ignored. I'm pretty certain it is actually reading the file because I added ARGV << "--debug" to config.ru and when I run things again I am seeing debug messages in syslog. So it appears the config.ru is being read.




Matthaus Owens

unread,
Apr 11, 2014, 12:12:45 PM4/11/14
to Puppet Users
For puppet 3.4.0 I would recommend using the config.ru that comes with
puppet as an example. You can find it here:
https://github.com/puppetlabs/puppet/blob/stable/ext/rack/config.ru

Some aspects of it are different from the config.ru that you pasted,
for example,
This is what you pasted:

require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

And this is what is in the config.ru that we ship in ext:

require 'puppet/util/command_line'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Util::CommandLine.new.execute

These are very different invocations, and the comment in the config.ru
that I linked hint at config loading problems with the old
implementation, which is what you are using.

HTH
> https://groups.google.com/d/msgid/puppet-users/CAEisTLnvt1nWaFWupeNvQTz%2B8YFRu9-OkZsBLVFKMJL2cJ7m%2Bw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Matthaus Owens
Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco -
http://bit.ly/pupconf14
Register now and save $350!
Reply all
Reply to author
Forward
0 new messages