# comment 
class egg::postgres () {
  package { ['postgresql', 'postgresql-contrib']:
    ensure => 'installed',
  }
  class { 'postgresql::server': }

  postgresql::server::db { 'nta-digital_nodejs':
    user     => 'nilpa76',
    encoding => 'UTF8',
    locale   => 'en_US.UTF-8',
  }

  postgresql::server::pg_hba_rule { 'allow local access as postgres user':
    type        => 'local',
    database    => 'all',
    user        => 'postgres',
    auth_method => 'trust',
  }

  postgresql::server::pg_hba_rule { 'allow localhost access':
    type        => 'host',
    database    => 'all',
    user        => 'all',
    address     => '127.0.0.1/32',
    auth_method => 'trust',
  }

  postgresql::server::pg_hba_rule { 'allow ipv6 localhost access':
    type        => 'host',
    database    => 'all',
    user        => 'all',
    address     => '::1/128',
    auth_method => 'trust',
  }
}