Re: [Puppet Users] How to install phppgadmin with puppet?

135 views
Skip to first unread message

Jakov Sosic

unread,
Sep 15, 2012, 6:02:48 PM9/15/12
to puppet...@googlegroups.com
On 09/15/2012 09:32 PM, Adnan Doric wrote:
> Hello all,
>
> I'm vagrant user completely new to puppet but enjoying it so far!
>
> I would like to install phppgadmin with it's dependencies (postgres 9.1,
> apache 2, php 5) and be able to access it on
> http://localhost/phppgadmin/ with postgres root user.
>
> It is a task far too complicated for me until I learn more about puppet
> so if you can help me do it or find an existing module or at least a
> thorough tutorial so I can do it myself it would be great!
>
> Thank you in advance

Task is not that hard, but first you need to learn puppet. You *have to*
go through all the documentation online, and try examples, become aware
of the differences between resources, variables, modules...

The time consumed for all these tasks will depend hugely on how fast of
a learner are you and do you have anyone at hand who can show you
basics. Puppet is as simple as it can be, for the task it's designed
for, but nevertheless you have to invest some time in it.

So your starting point should be:

http://docs.puppetlabs.com/learning/

Go through sections:

Resources and the RAL
Variables, Conditionals, and Facts
Modules and Classes (Part One)
Templates


After that test your configurations on a dev system. Test test test. Try
and make error, then retry and fail again.


Also note that if you continue to use puppet, you will probably re-write
your manifests and classes couple of times along the way in the first 6
months of using it.

If you want to do a one-time-task, and don't intend to use puppet
extensively in the future, then I recommend writing a shell script :)



And to address your main issue, installig pgadmin should be easy. If you
don't plan to do some fancy stuff it will come down to this (on CentOS
for example):

package {'httpd':
ensure => present
}
service {'httpd':
ensure => running,
enable => true,
require => Package['httpd'],
}
package {'phppgadmin':
ensure => present,
}
package {'phpPgAdmin':
ensure => present,
notify => Service['httpd'],
}


And that's about it. But beware, you must have an idea about what are
you doing, because sooner or later it *will* byte you in the ass. So
please, don't even think about skipping the learning curve.




--
Jakov Sosic
www.srce.unizg.hr

Adnan Doric

unread,
Sep 16, 2012, 5:21:09 AM9/16/12
to puppet...@googlegroups.com

I already have a starting point which is this vagrant setup:
https://github.com/amaia/rails-starter-box

Postgres is already included, I just have to figure out how to include phppgadmin in it.

I guess I have to read now :)

Thank you a lot for your help!

Jakov Sosic

unread,
Sep 16, 2012, 3:04:57 PM9/16/12
to puppet...@googlegroups.com
> www.srce.unizg.hr <http://www.srce.unizg.hr>
>
>
> I already have a starting point which is this vagrant setup:
> https://github.com/amaia/rails-starter-box
>
> Postgres is already included, I just have to figure out how to include
> phppgadmin in it.
>
> I guess I have to read now :)

Yeah because you won't be able to use other people's classes if you
don't understand what are they doing...

For example:


>
> Thank you a lot for your help!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/gZS8H_hcM54J.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.


--
Jakov Sosic
www.srce.unizg.hr

Jakov Sosic

unread,
Sep 16, 2012, 3:09:15 PM9/16/12
to puppet...@googlegroups.com
On 09/16/2012 11:21 AM, Adnan Doric wrote:

> I already have a starting point which is this vagrant setup:
> https://github.com/amaia/rails-starter-box
>
> Postgres is already included, I just have to figure out how to include
> phppgadmin in it.
>
> I guess I have to read now :)

Yeah because you won't be able to use other people's classes if you
don't understand what are they doing...

For example:

https://github.com/amaia/rails-starter-box/blob/master/puppet/manifests/default.pp

this is the main file in setup you've pointed out. It uses three
different classes that other people (mainly puppetlabs) wrote. That
classes install packages, set up user for database, etc.

Now to add pgadmin to that system you have to choose if you want to add
it from source, or from I presume Ubuntu deb packages. Also, you have to
manage apache somehow, and if you plan to stay consistent with the
current setup than it's problably the best idea to use puppetlabs apache
modue:

https://github.com/puppetlabs/puppetlabs-apache

Take a look at how vagrant added puppetlabs-postgresl module (it's
linked in /etc/puppet/modules dir), and how he uses it, and read
documentation of puppetlabs-apache module and try to get "Welcome" page
(simple apache installation) with that module, and then go on from there
towards pgadmin.

Hope it helps!
Reply all
Reply to author
Forward
0 new messages