Hi Devs,

I have created a PostgreSQL cartridge [3] for Apache Stratos. It consists
of 2 modules.

   - PostgreSQL server
   - phpPgAdmin web interface


*PostgreSQL server*

I have utilized PostgreSQL puppet module [1] from puppet laps and plugged
in my phpPgAdmin module[2] to come up with a PostgreSQL cartridge.

Puppet laps' PostgreSQL module has several great features. Some of them
are,

   - configure and manage PostgreSQL server (for example, who can access
   and/or from where)
   - creating and managing databases
   - managing users, roles and permissions
   - install PostgreSQL bindings for languages such as java (JDBC), Perl
   and Python.

There are more, you may refer [1] for the complete documentation.

*phpPgAdmin Web Interface*

I have developed a phpPgAdmin puppet module [2] for PostgreSQL server
management through browsers.

*Usage*

 Everything is documented in more detail here [3].

Sample cartridge deployment would looks like below in an openstack
environment,

{
  "type": "postgresql",
  "provider": "data",
  "host": "stratos.com",
  "displayName": "postgresql",
  "description": "postgresql Cartridge",
  "version": "9.1",
  "multiTenant": "false",
  "portMapping": [
    {
      "protocol": "http",
      "port": "*5432*",
      "proxyPort": "80"
    }
  ],
  "deployment": {},
  "iaasProvider": [
    {
      "type": "openstack",
      "imageId": "RegionOne/f2ddf72a-4e76-4893-a9fa-e5f4352f1a86",
      "property": [
        {
          "name": "instanceType",
          "value": "RegionOne/3"
        },
{
          "name": "keyPair",
          "value": "raj-openstack"
        },
{
          "name": "securityGroups",
          "value": "all-open"
        }
      ]
    }
  ]
}

Sample node definition (in nodes.pp) would looks like,

# postgresql cartridge node
node /postgresql/ inherits base {
  require java
  class {'agent':}

  class { 'postgresql::server':
    ip_mask_deny_postgres_user => '0.0.0.0/32',
    ip_mask_allow_all_users    => '0.0.0.0/0',
    listen_addresses           => '*',
    manage_firewall            => true,
    postgres_password          => 'postgres'
  }

  postgresql::server::db { 'stratos-postgres-sample':
    user     => 'root',
    password => postgresql_password('root', 'root'),
  }

  class {'phppgadmin':
    db_host   => 'localhost',
    db_port        => '5432',
    owned_only    => false,
    extra_login_security => false
  }

  Class['postgresql::server']->Class['phppgadmin']~> Class['agent']
}

I have sent pull request 4.0.0

Can someone review and merge the pull request [4]?

1. https://forge.puppetlabs.com/puppetlabs/postgresql
2. https://github.com/R-Rajkumar/phppgadmin.git
3.
http://blog.rajkumarr.com/2014/08/using-postgresql-cartridge-on-apache-stratos.html
4. https://github.com/apache/stratos/pull/9

Thanks.

-- 
Rajkumar Rajaratnam
Software Engineer | WSO2, Inc.
Mobile +94777568639 | +94783498120

Reply via email to