Skip to content

Commit

Permalink
adding Ubuntu support
Browse files Browse the repository at this point in the history
  • Loading branch information
flipkick committed May 16, 2013
1 parent b715ab4 commit db22bf9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$db_port = $phppgadmin::params::db_port
) inherits phppgadmin::params {
# Supported OS
$supported_os = ['^CentOS$']
$supported_os = ['^CentOS$', '^Ubuntu$']
validate_re($::operatingsystem,$supported_os)

$http_conf_file = $phppgadmin::params::http_conf_file
Expand Down Expand Up @@ -68,7 +68,7 @@
file{$http_conf_file:
ensure => present,
mode => '0644',
content => template('phppgadmin/phpPgAdmin.conf.erb'),
content => template($http_conf_template_file),
require => Package[$phppgadmin_package],
}

Expand Down
11 changes: 10 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class phppgadmin::params {

# Supported OS
$supported_os = ['^CentOS$']
$supported_os = ['^CentOS$', '^Ubuntu$']
validate_re($operatingsystem,$supported_os)

$install_apache = false # if true, default apache install using puppetlabs-apache
Expand All @@ -31,16 +31,25 @@

$phppgadmin_package = $operatingsystem ? {
CentOS => 'phpPgAdmin',
Ubuntu => 'phppgadmin',
default => undef,
}

$phppgadmin_conf_file = $operatingsystem ? {
CentOS => '/etc/phpPgAdmin/config.inc.php',
Ubuntu => '/etc/phppgadmin/config.inc.php',
default => undef,
}

$http_conf_file = $operatingsystem ? {
CentOS => '/etc/httpd/conf.d/phpPgAdmin.conf',
Ubuntu => '/etc/apache2/conf.d/phppgadmin',
default => undef,
}

$http_conf_template_file = $operatingsystem ? {
CentOS => 'phppgadmin/CentOS/phpPgAdmin.conf.erb',
Ubuntu => 'phppgadmin/Ubuntu/phppgadmin.conf.erb',
default => undef,
}
}
File renamed without changes.
37 changes: 37 additions & 0 deletions templates/Ubuntu/phppgadmin.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Managed by Puppet module knowshan/phppgadmin

#
# This configuration file maps the phppgadmin directory into the URL space.
# By default this application is only accessible from the local host.
#

Alias /phpPgAdmin /usr/share/phppgadmin

<Directory /usr/share/phppgadmin>

DirectoryIndex index.php
AllowOverride None

order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128

<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_value include_path .
</IfModule>
<IfModule !mod_php5.c>
<IfModule mod_actions.c>
<IfModule mod_cgi.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
<IfModule mod_cgid.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
</IfModule>
</IfModule>

</Directory>

0 comments on commit db22bf9

Please sign in to comment.