## postgresql_cd::main::files.pp
# Module name: postgresql_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages logic for the postgresql_cd module.
##############################################################################
class postgresql_cd::main::files (

) inherits postgresql_cd::params {
  if $fqdn == $pl_server_fqdn {
    require postgresql_cd::server::initdb
    require postgresql_cd::main::dirs

    file { '/var/lib/pgsql/data/postgresql.conf':
      ensure   => file,
      owner    => 'postgres',
      group    => 'postgres',
      mode     => '0600',
      selrange => s0,
      selrole  => object_r,
      seltype  => postgresql_db_t,
      seluser  => unconfined_u,
      content  => template('postgresql_cd/postgresql.conf.erb'),
      notify   => Service[$pl_service],
    }
  }
}
