From 8ba19d2357889e167b7a377fdb72267ff6e38516 Mon Sep 17 00:00:00 2001 From: Rafael Gloria Date: Fri, 1 Jul 2016 11:53:22 -0300 Subject: [PATCH] Inserindo arquivos do módulo de instalação do SIMEC via PUPPET --- README.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------- Rakefile | 18 ++++++++++++++++++ examples/init.pp | 14 ++++++++++++++ files/apt.postgresql.org.sh | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ files/dump_simec.tar.gz | Bin 0 -> 33400215 bytes manifests/apache.pp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ manifests/config.pp | 29 +++++++++++++++++++++++++++++ manifests/init.pp | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ manifests/install.pp | 24 ++++++++++++++++++++++++ manifests/params.pp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ manifests/postgresql.pp | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ metadata.json | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ spec/classes/init_spec.rb | 7 +++++++ spec/spec_helper.rb | 17 +++++++++++++++++ templates/configinc.erb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ templates/database.erb | 31 +++++++++++++++++++++++++++++++ templates/postgresql.conf.centos.erb | 603 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ templates/postgresql.conf.debian.erb | 602 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/init.pp | 12 ++++++++++++ 19 files changed, 2076 insertions(+), 57 deletions(-) create mode 100644 Rakefile create mode 100644 examples/init.pp create mode 100644 files/apt.postgresql.org.sh create mode 100644 files/dump_simec.tar.gz create mode 100644 manifests/apache.pp create mode 100644 manifests/config.pp create mode 100644 manifests/init.pp create mode 100644 manifests/install.pp create mode 100644 manifests/params.pp create mode 100644 manifests/postgresql.pp create mode 100644 metadata.json create mode 100644 spec/classes/init_spec.rb create mode 100644 spec/spec_helper.rb create mode 100644 templates/configinc.erb create mode 100644 templates/database.erb create mode 100644 templates/postgresql.conf.centos.erb create mode 100644 templates/postgresql.conf.debian.erb create mode 100644 tests/init.pp diff --git a/README.md b/README.md index e24ddcc..2402f89 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Simec - Sistema Integrado de Monitoramento, Execução e Controle +# Simec - Sistema Integrado de Monitoramento, Execução e Controle -#### Tabela de Conteúdo +#### Tabela de Conteúdo 1. [Sobre](#sobre) 2. [Compatibilidade](#compatibilidade) @@ -9,36 +9,36 @@ 5. [ServerLess](#serverless) 6. [Uso](#uso) 7. [Classes](#classes) -8. [Parâmetros](#parametros) +8. [Parâmetros](#parametros) 9. [Acesso](#acesso) 10. [Pendente](#pendente) -11. [Referências](#referencias) +11. [Referências](#referencias) ## Sobre -O SIMEC é uma ferramenta web escrita em linguagem PHP e com servidor de banco de dados -PostgreSQL. O sistema em PHP é responsável pela lógica do servidor com interfaces do lado do -cliente escritas em Javascript, enquanto o PostgreSQL faz o papel de repositório de dados. +O SIMEC é uma ferramenta web escrita em linguagem PHP e com servidor de banco de dados +PostgreSQL. O sistema em PHP é responsável pela lógica do servidor com interfaces do lado do +cliente escritas em Javascript, enquanto o PostgreSQL faz o papel de repositório de dados. -Esse módulo pode instalar e configurar o Apache, baixar o código de um repositório remoto, instalar +Esse módulo pode instalar e configurar o Apache, baixar o código de um repositório remoto, instalar o banco de dados PostgresSQL localmente ou configurar o acesso a um banco remoto. ## Compatibilidade - * Compatível com CentOS 7 e Debian >= 7 + * Compatível com CentOS 7 e Debian >= 7 * Escrito com recursos do Puppet 3. * O Simec utiliza APACHE 2 e PostgreSQL 8.4 ou superior. - * Este módulo usa **PostgreSQL 9.3.** + * Este módulo usa **PostgreSQL 9.3.** ## Requisitos * Pelo menos 2 gigas de RAM * Pelo menos 10 gigas de disco - * Acesso a internet para instalação de pacotes + * Acesso a internet para instalação de pacotes ## Setup **Install Puppet** -Instale o repositório do puppet para o seu Sistema Operacional. +Instale o repositório do puppet para o seu Sistema Operacional. Debian $ wget https://apt.puppetlabs.com/puppetlabs-release-stable.deb @@ -50,7 +50,7 @@ Instale o repositório do puppet para o seu Sistema Operacional. $ sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm # yum install puppet-agent -Em caso de instalações ServerLess, será preciso instalar o módulo no diretório de módulos de acordo com o S.O. +Em caso de instalações ServerLess, será preciso instalar o módulo no diretório de módulos de acordo com o S.O. Gerelamente no Debian: @@ -70,20 +70,20 @@ Dependendo do Sistema Operacional. ## ServerLess -Após criar o manifest, execute o puppet em modo serverless. (obs.: é necessário -instalar os módulos de dependência.) +Após criar o manifest, execute o puppet em modo serverless. (obs.: é necessário +instalar os módulos de dependência.) # puppet module install puppetlabs-vcsrepo # puppet module install puppetlabs-apache # puppet module install herculesteam-augeasproviders_postgresql # puppet apply /tmp/meusimec.pp -obs.: /tmp/meusimec.pp é o arquivo com a declaração da classe (Veja mais em [Uso](#uso)). +obs.: /tmp/meusimec.pp é o arquivo com a declaração da classe (Veja mais em [Uso](#uso)). ## Uso -Para instalar o SIMEC com banco local (o padrão é banco remoto) e parâmetros padrões: +Para instalar o SIMEC com banco local (o padrão é banco remoto) e parâmetros padrões: ```puppet class { '::simec': @@ -104,8 +104,8 @@ class {'::simec': } ``` -Para especificar um repositório, DocumentRoot e um sistema de controle de versão diferente do git, use: -(obs.: é necessário um repositório com permissão de clone (git) ou chekout (svn) sem exigir autenticação.) +Para especificar um repositório, DocumentRoot e um sistema de controle de versão diferente do git, use: +(obs.: é necessário um repositório com permissão de clone (git) ou chekout (svn) sem exigir autenticação.) ```puppet class {'::simec': @@ -115,7 +115,7 @@ class {'::simec': vcsprovider => 'svn' } ``` -Exemplo de uma declaração com TODOS os parâmetros: +Exemplo de uma declaração com TODOS os parâmetros: ```puppet class {'::simec': @@ -141,129 +141,129 @@ class {'::simec': #### Classe simec::apache - * Instalação e configuração do Apache - * Módulos do Apache - * Configuração do Vhost com Aliases, etc. - * Configuração do Parâmetros do PHP no Vhost via php_value e php_admin. + * Instalação e configuração do Apache + * Módulos do Apache + * Configuração do Vhost com Aliases, etc. + * Configuração do Parâmetros do PHP no Vhost via php_value e php_admin. #### Classe simec::postgresql - * Instalação do Servidor PostgreSQL. - * Configuração do Repositório oficial do PostgreSQL. - * Instalação dos pacotes do PostGis (GeoProcessamento). - * Criação da Base de Dados. - * Configuração do pg_hba.conf. + * Instalação do Servidor PostgreSQL. + * Configuração do Repositório oficial do PostgreSQL. + * Instalação dos pacotes do PostGis (GeoProcessamento). + * Criação da Base de Dados. + * Configuração do pg_hba.conf. * Restore do Dump da Base de Dados. #### Classe simec::install - * Instalação dos Pacotes php. - * Instalação do Pacote do Provider para o VCSREPO (Controle de versionamento, git, svn, etc.). - * Clone, etc. do Repositório com o código do SIMEC para o $datadir definido. + * Instalação dos Pacotes php. + * Instalação do Pacote do Provider para o VCSREPO (Controle de versionamento, git, svn, etc.). + * Clone, etc. do Repositório com o código do SIMEC para o $datadir definido. #### Classe simec::config - * Configuração dos arquivos do SIMEC via Template ERB. + * Configuração dos arquivos do SIMEC via Template ERB. * Arquivo principal do simec (config.inc). - * Arquivo de Configuração para conexão com o Banco (database.php). + * Arquivo de Configuração para conexão com o Banco (database.php). #### Classe simec::params - * Configuração dos parâmetros padrões. - * Definição do $apacheuser de acordo com o facter osfamily (RedHat e Debian). - * Definição dos pacotes a serem instalados. + * Configuração dos parâmetros padrões. + * Definição do $apacheuser de acordo com o facter osfamily (RedHat e Debian). + * Definição dos pacotes a serem instalados. #### Classe simec:init * Classe principal para saber como chamar (Veja mais em [Uso](#uso)). - * Verificação do valor da variável $instal_db para decidir se há necessidade de instalação do banco localmente ou não. + * Verificação do valor da variável $instal_db para decidir se há necessidade de instalação do banco localmente ou não. -## Parâmetros +## Parâmetros -### Informações do Parâmetros +### Informações do Parâmetros [**vhost**] -Domínio que será configurado no vhost ex.: simec.seudominio.gov. **Valor Padrão: simec.dominio.gov.br** +Domínio que será configurado no vhost ex.: simec.seudominio.gov. **Valor Padrão: simec.dominio.gov.br** [**datadir**] -Local em que o código será baixado e serão feitos os apontamentos no vhost. **Valor Padrão: /var/www/html/simec** +Local em que o código será baixado e serão feitos os apontamentos no vhost. **Valor Padrão: /var/www/html/simec** [**apacheuser**] -Usuário do serviço apache, definido automaticamente pelo facter osfamily caso seja RedHat ou Debian +Usuário do serviço apache, definido automaticamente pelo facter osfamily caso seja RedHat ou Debian [**db_username**] -Nome do usuário de conexão com o banco de dados. **Valor Padrão: user_simec** +Nome do usuário de conexão com o banco de dados. **Valor Padrão: user_simec** [**db_password**] -Senha de conexão com o banco de dados. **Valor Padrão: 841j8K9J67p788x** +Senha de conexão com o banco de dados. **Valor Padrão: 841j8K9J67p788x** [**db_name**] -Nome da base de dados. **Valor Padrão: db_simec** +Nome da base de dados. **Valor Padrão: db_simec** [**db_host**] -IP ou nome do servidor de banco de dados. **Valor Padrão: $::ipaddress** +IP ou nome do servidor de banco de dados. **Valor Padrão: $::ipaddress** [**db_port**] -Porta de Conexão com o servidor de banco de dados. **Valor Padrão: 5432** +Porta de Conexão com o servidor de banco de dados. **Valor Padrão: 5432** [**vcsprovider**] -Pacote do Sistema de Controle de Versionamento. **Valor Padrão: git** +Pacote do Sistema de Controle de Versionamento. **Valor Padrão: git** [**repoensure**] -Definição se será realizado o download do código via VCSREPO. **Valor Padrão: present** (Fazer Download) +Definição se será realizado o download do código via VCSREPO. **Valor Padrão: present** (Fazer Download) [**source**] -URL do Repositório do código. **Valor padrão: https://softwarepublico.gov.br/gitlab/simec/simec.git** +URL do Repositório do código. **Valor padrão: https://softwarepublico.gov.br/gitlab/simec/simec.git** [**emails**] -Emails configurados no arquivo de configuração principal do SIMEC config.inc para receber informações do sistema. +Emails configurados no arquivo de configuração principal do SIMEC config.inc para receber informações do sistema. [**install_db**] -Variável booleana para definir se será instalado o banco de dados localmente. **Valor Padrão: false** +Variável booleana para definir se será instalado o banco de dados localmente. **Valor Padrão: false** ### Acesso -Sistema instalado e o apontamento no DNS para o domínio escolhido ($vhost) ao menos na máquina com o navegador. +Sistema instalado e o apontamento no DNS para o domínio escolhido ($vhost) ao menos na máquina com o navegador. -Acesso ao endereço no navegador Ex:"http://simec.dominio.gov.br". Carregada a página de login, o sistema solicitará o CPF e a SENHA para acesso. +Acesso ao endereço no navegador Ex:"http://simec.dominio.gov.br". Carregada a página de login, o sistema solicitará o CPF e a SENHA para acesso. @@ -275,8 +275,8 @@ Acesso administrativo: ### Pendente -Configuração do módulo para outros Sistemas Operacionais. +Configuração do módulo para outros Sistemas Operacionais. -### Referências +### Referências * https://softwarepublico.gov.br/social/simec/ diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..d1e11f7 --- /dev/null +++ b/Rakefile @@ -0,0 +1,18 @@ +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] + +desc "Validate manifests, templates, and ruby files" +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end diff --git a/examples/init.pp b/examples/init.pp new file mode 100644 index 0000000..d5cdec2 --- /dev/null +++ b/examples/init.pp @@ -0,0 +1,14 @@ +class {'::simec': + vhost => 'meusimec.dominio', + source => 'http://repositoriodosimec', + datadir => '/var/www/html/simec', + install_db => true, + db_name => 'dbsimec', + db_username => 'usrsimec', + db_password => 'MinhaSenhaForte', + db_port => '5432', + emails => 'meuemail@meudominio ; outroemail@outrodominio', + vcsprovider => 'git', + apacheuser => 'apache', + repoensure => 'present' +} diff --git a/files/apt.postgresql.org.sh b/files/apt.postgresql.org.sh new file mode 100644 index 0000000..52c614c --- /dev/null +++ b/files/apt.postgresql.org.sh @@ -0,0 +1,166 @@ +#!/bin/sh + +# script to add apt.postgresql.org to sources.list + +# from command line +CODENAME="$1" +# lsb_release is the best interface, but not always available +if [ -z "$CODENAME" ]; then + CODENAME=$(lsb_release -cs 2>/dev/null) +fi +# parse os-release (unreliable, does not work on Ubuntu) +if [ -z "$CODENAME" -a -f /etc/os-release ]; then + . /etc/os-release + # Debian: VERSION="7.0 (wheezy)" + # Ubuntu: VERSION="13.04, Raring Ringtail" + CODENAME=$(echo $VERSION | sed -ne 's/.*(\(.*\)).*/\1/') +fi +# guess from sources.list +if [ -z "$CODENAME" ]; then + CODENAME=$(grep '^deb ' /etc/apt/sources.list | head -n1 | awk '{ print $3 }') +fi +# complain if no result yet +if [ -z "$CODENAME" ]; then + cat < /etc/apt/sources.list.d/pgdg.list < 'prefork', + } + + include ::apache::mod::php + include ::apache::mod::rewrite + + apache::vhost { $vhost: + servername => $vhost, + port => '80', + docroot => "${datadir}/www", + docroot_owner => "${apacheuser}", + docroot_group => "${apacheuser}", + options => ['Indexes','FollowSymLinks'], + directoryindex => 'login.php index.php', + access_log_file => "${vhost}_access_log", + error_log_file => "${vhost}_error_log", + aliases => [ + { + alias => '/seguranca', + path => "${datadir}/seguranca/www/", + }, + { + alias => '/elabrev', + path => "${datadir}/elabrev/www", + }, + { + alias => '/monitora', + path => "${datadir}/monitora/www", + }, + { + alias => '/financeiro', + path => "${datadir}/financeiro/www", + }, + { + alias => '/zimec', + path => "${datadir}/zimec/public", + }, + { + alias => '/pde', + path => "${datadir}/pde/www", + }, + ], + custom_fragment => " + AddDefaultCharset ISO-8859-1 + php_admin_value output_buffering on + php_admin_value error_reporting 22519 + php_value upload_max_filesize 128M + php_value post_max_size 128M + php_value max_execution_time 60 + php_value max_input_time 60 + php_value memory_limit 256M + php_admin_value include_path \".:${datadir}/global\" + php_admin_value short_open_tag on + php_admin_value date.timezone America/Sao_Paulo + ", + } +} diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..d457e7a --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,29 @@ +class simec::config ( +$datadir = $::simec::params::datadir, +$db_username = $::simec::params::db_username, +$db_password = $::simec::params::db_password, +$db_name = $::simec::params::db_name, +$db_host = $::simec::params::db_host, +$db_port = $::simec::params::db_port, +$apacheuser = $::simec::params::apacheuser, +$emails = $::simec::params::emails, + +) inherits simec::params { + + # Config arquivo principal de configuracao + + file { "${datadir}/global/config.inc": + ensure => present, + owner => $apacheuser, + mode => '0400', + content => template('simec/configinc.erb'), + require => Vcsrepo[$datadir], + } + file { "${datadir}/global/database.php": + ensure => present, + owner => $apacheuser, + mode => '0400', + content => template('simec/database.erb'), + require => Vcsrepo[$datadir], + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..6985524 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,98 @@ +# == Class: simec +# +# Full description of class simec here. +# +# === Parameters +# +# Document parameters here. +# +# [*sample_parameter*] +# Explanation of what this parameter affects and what it defaults to. +# e.g. "Specify one or more upstream ntp servers as an array." +# +# === Variables +# +# Here you should define a list of variables that this module would require. +# +# [*sample_variable*] +# Explanation of how this variable affects the funtion of this class and if +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the +# External Node Classifier as a comma separated list of hostnames." (Note, +# global variables should be avoided in favor of class parameters as +# of Puppet 2.6.) +# +# === Examples +# +#class {'simec': +# vhost => 'meusimec.dominio', +# install_db => false, +# db_name => 'dbsimec', +# db_username => 'usersimec', +# db_password => 'SenhaSuperForte', +# db_host => '192.168.0.1', +# datadir => '/var/www/html/simec', +# source => 'http://urldorepositporiop/simec.git', +# emails => 'meuemail@meudominio', +# vcsprovider => 'git', +#} +# +# === Authors +# +# Thiago Linux +# +# === Copyright +# +# Copyright 2016 Your name here, unless otherwise noted. +# +class simec ( +$vhost = $::simec::params::vhost, +$datadir = $::simec::params::datadir, +$apacheuser = $::simec::params::apacheuser, +$db_username = $::simec::params::db_username, +$db_password = $::simec::params::db_password, +$db_name = $::simec::params::db_name, +$db_host = $::simec::params::db_host, +$db_port = $::simec::params::db_port, +$packages = $::simec::params::packages, +$vcsprovider = $::simec::params::vcsprovider, +$repoensure = $::simec::params::repoensure, +$source = $::simec::params::source, +$emails = $::simec::params::emails, +$install_db = false, +) inherits simec::params { + + class { '::simec::install': + repoensure => $reponsure, + datadir => $datadir, + packages => $packages, + vcsprovider => $vcsprovider, + source => $source, + } -> + class { '::simec::apache': + vhost => $vhost, + datadir => $datadir, + apacheuser => $apacheuser, + } -> + class { '::simec::config': + datadir => $datadir, + apacheuser => $apacheuser, + db_username => $db_username, + db_password => $db_password, + db_name => $db_name, + db_host => $db_host, + db_port => $db_port, + emails => $emails, + + } + + if $install_db == true { + class { '::simec::postgresql': + db_username => $db_username, + db_password => $db_password, + db_name => $db_name, + db_host => $db_host, + db_port => $db_port, + } + } + +} diff --git a/manifests/install.pp b/manifests/install.pp new file mode 100644 index 0000000..2d99b8b --- /dev/null +++ b/manifests/install.pp @@ -0,0 +1,24 @@ +class simec::install ( +$datadir = $::simec::params::datadir, +$packages = $::simec::params::packages, +$vcsprovider = $::simec::params::vcsprovider, +$repoensure = $::simec::params::repoensure, +$source = $::simec::params::source, + +) inherits simec::params { + + package { $packages : + ensure => present, + } + + package { $vcsprovider : + ensure => present, + } + + vcsrepo { $datadir: + ensure => $repoensure, + provider => $vcsprovider, + source => $source, + require => Package[$vcsprovider], + } +} diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..6f54e0e --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,46 @@ +class simec::params { + $vhost = 'simec.dominio.gov.br' + $db_username = 'user_simec' + $db_password = '841j8K9J67p788x' + $db_name = 'db_simec' + $db_host = "$::ipaddress" + $db_port = '5432' + $datadir = '/var/www/html/simec/' + $repoensure = 'present' + $vcsprovider = 'git' + $source = 'https://softwarepublico.gov.br/gitlab/simec/simec.git' + $emails = 'seuemail@dominio' + + case $::osfamily { + + 'RedHat': { + $apacheuser = 'apache' + $packages = [ + 'php-pgsql', + 'php-gd', + 'php-mbstring', + 'php-bcmath', + 'php-soap', + 'gzip', + ] + + } + + 'Debian': { + $apacheuser = 'www-data' + $packages = [ + 'php5-pgsql', + 'php5-gd', + 'php5-curl', + 'php-soap', + 'gzip', + 'sudo', + ] + } + + default: { + fail("${module_name} module is not supported on osfamily ${::osfamily}.") + } + + } +} diff --git a/manifests/postgresql.pp b/manifests/postgresql.pp new file mode 100644 index 0000000..6d1d018 --- /dev/null +++ b/manifests/postgresql.pp @@ -0,0 +1,180 @@ +class simec::postgresql ( +$db_username = $::simec::params::db_username, +$db_password = $::simec::params::db_password, +$db_name = $::simec::params::db_name, +$db_host = $::simec::params::db_host, +$db_port = $::simec::params::db_port, +) inherits simec::params { + + + case $::osfamily { + + 'RedHat': { + + # Instar o repositório + exec { 'exclude_pkg_centos': + command => "sed -i 's/[base]/[base]\nexclude=postgresql*/g' /etc/yum.repos.d/CentOS-Base.repo", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + unless => "cat /etc/yum.repos.d/CentOS-Base.repo | grep \"exclude=postgresql\"", + notify => Exec['postgres_repo'], + } + + exec { 'postgres_repo': + command => "yum localinstall https://download.postgresql.org/pub/repos/yum/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-2.noarch.rpm -y", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + require => Exec['exclude_pkg_centos'], + refreshonly => true, + } + + package { [ 'epel-release', 'postgresql93-server', 'postgresql93', 'postgresql93-libs', 'postgresql93-contrib' ] : + ensure => installed, + notify => Exec['run_initdb'], + require => Exec['postgres_repo'] + }-> + package { [ 'gdal', 'gdal-devel', 'gdal-java', 'gdal-perl', 'gdal-python' ] : + ensure => installed, + require => Exec['run_initdb'] + }-> + package { [ 'postgis2_93', 'postgis2_93-devel', 'postgis2_93-docs', 'postgis2_93-utils' ] : + ensure => installed + }-> + pg_hba { "host to $db_username on $db_name from $::ipaddress/32": + ensure => present, + method => 'md5', + target => '/var/lib/pgsql/9.3/data/pg_hba.conf', + }-> + file { '/var/lib/pgsql/9.3/data/postgresql.conf': + force => true, + ensure => 'file', + group => 'postgres', + mode => '600', + owner => 'postgres', + content => template('simec/postgresql.conf.centos.erb'), + notify => [ + Service['postgresql'], + Exec['setup_db'] + ] + } + + exec { 'run_initdb': + command => "/usr/pgsql-9.3/bin/postgresql93-setup initdb", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/pgsql-9.3/bin', + refreshonly => true, + } + + service { 'postgresql': + name => 'postgresql-9.3', + ensure => running, + enable => true, + require => File['/var/lib/pgsql/9.3/data/postgresql.conf'], + } + + + + + augeas { "turn off sudo requiretty": + changes => [ + 'set /files/etc/sudoers/Defaults[*]/requiretty/negate ""', + ], + } + + exec { 'restore_db': + environment => "PGPASSWORD=$db_password", + command => "gunzip -c /opt/dump_simec.tar.gz | pg_restore -h $db_host -U $db_username -v -p $db_port -d $db_name 2> /tmp/out_restore_$db_name", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + require => [ + Service['postgresql'], + File['/opt/dump_simec.tar.gz'], + Augeas['turn off sudo requiretty'], + ], + returns => [0, 1], + refreshonly => true, + } + + } + + 'Debian': { + + # instalar repositorio + file { '/opt/apt.postgresql.org.sh': + ensure => file, + mode => '0754', + owner => 'root', + group => 'root', + source => 'puppet:///modules/simec/apt.postgresql.org.sh', + notify => Exec['postgres_repo_apt'] + } + exec { 'postgres_repo_apt': + command => "sh /opt/apt.postgresql.org.sh", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + require => File['/opt/apt.postgresql.org.sh'], + refreshonly => true, + } + + package { [ 'postgresql-9.3-postgis-2.1', 'postgresql-9.3-postgis-2.1-scripts', 'postgresql-client-9.3', 'postgresql-contrib-9.3' ] : + ensure => installed, + require => Exec['postgres_repo_apt'] + }-> + pg_hba { "host to $db_username on $db_name from $::ipaddress/32": + ensure => present, + method => 'md5', + target => '/etc/postgresql/9.3/main/pg_hba.conf', + }-> + file { '/etc/postgresql/9.3/main/postgresql.conf': + force => true, + ensure => 'file', + group => 'postgres', + mode => '600', + owner => 'postgres', + content => template('simec/postgresql.conf.debian.erb'), + notify => [ + Service['postgresql'], + Exec['setup_db'] + ] + } + + service { 'postgresql': + name => 'postgresql', + ensure => running, + enable => true, + require => [ + File['/etc/postgresql/9.3/main/postgresql.conf'], + ], + } + + exec { 'restore_db': + environment => "PGPASSWORD=$db_password", + command => "gunzip -c /opt/dump_simec.tar.gz | pg_restore -h $db_host -U $db_username -v -p $db_port -d $db_name 2> /tmp/out_restore_$db_name", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + require => [ + Service['postgresql'], + File['/opt/dump_simec.tar.gz'] + ], + returns => [0, 1], + refreshonly => true, + } + } + + + default: { + fail("${module_name} module is not supported on osfamily ${::osfamily}.") + } + + } + + file { '/opt/dump_simec.tar.gz': + ensure => file, + mode => '0644', + owner => 'root', + group => 'root', + source => 'puppet:///modules/simec/dump_simec.tar.gz', + } + + exec { 'setup_db': + command => "sudo -u postgres psql -c \"create user $db_username with password \'$db_password\' superuser;\" && sudo -u postgres psql -c \"create database $db_name with owner = $db_username encoding \'UTF8\'\"", + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', + require => Service['postgresql'], + notify => Exec['restore_db'], + refreshonly => true + } +} diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..b1af1af --- /dev/null +++ b/metadata.json @@ -0,0 +1,55 @@ +{ + "name":"minc-simec", + "version":"0.1.0", + "author":"thiagolinux", + "summary":"Puppet module for install SIMEC", + "license":"Apache 2.0", + "source":"", + "project_page":"https://softwarepublico.gov.br/social/simec/", + "issues_url":null, + "operatingsystem_support":[ + { + "operatingsystem":"RedHat", + "operatingsystemrelease":[ + "7", + ] + }, + { + "operatingsystem":"CentOS", + "operatingsystemrelease":[ + "7", + ] + }, + { + "operatingsystem":"Debian", + "operatingsystemrelease":[ + "7", + "8" + ] + } + ], + "dependencies":[ + { + "name":"puppetlabs/apache", + "version_requirement":">= 1.10.0" + }, + { + "name":"puppetlabs/vcsrepo", + "version_requirement":">= 1.3.2" + }, + { + "name":"herculesteam/augeasproviders_postgresql", + "version_requirement":">= 2.0.3" + } + ], + "requirements":[ + { + "name":"pe", + "version_requirement":"3.x" + }, + { + "name":"puppet", + "version_requirement":"3.x" + } + ] +} diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb new file mode 100644 index 0000000..b8512ab --- /dev/null +++ b/spec/classes/init_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' +describe 'simec' do + + context 'with defaults for all parameters' do + it { should contain_class('simec') } + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5fda588 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,17 @@ +dir = File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH.unshift File.join(dir, 'lib') + +require 'mocha' +require 'puppet' +require 'rspec' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end diff --git a/templates/configinc.erb b/templates/configinc.erb new file mode 100644 index 0000000..6cabd3e --- /dev/null +++ b/templates/configinc.erb @@ -0,0 +1,53 @@ +/'); + defined('DIRFILES') || define('DIRFILES', APPRAIZ. 'arquivos/'); + defined('SISRAIZ') || define('SISRAIZ', APPRAIZ . $_SESSION['sisdiretorio'] . '/'); + defined('MAXONLINETIME') || define('MAXONLINETIME', 3600); + defined('IS_PRODUCAO') || define('IS_PRODUCAO', false); + + $_SESSION['ambiente'] = IS_PRODUCAO ? 'Ambiente de Produção' : 'Ambiente de Desenvolvimento'; + $_SESSION['sisbaselogin'] = $_REQUEST['baselogin'] && $_REQUEST['baselogin'] != "teste" ? $_REQUEST['baselogin'] : $_SESSION['sisbaselogin']; + $_SESSION['baselogin'] = $_REQUEST['baselogin'] ? $_REQUEST['baselogin'] : $_SESSION['baselogin']; + + # Configuração de Banco de Dados + include_once 'database.php'; + + $email_sistema = '<%= @emails %>'; + + preg_match('/\/([a-zA-Z]*)\//', $_SERVER['REQUEST_URI'], $sisdiretorio); + $sisdiretorio = $sisdiretorio[1]; + + preg_match('/\/([a-zA-Z]*)\.php/', $_SERVER['REQUEST_URI'], $sisarquivo); + $sisarquivo = $sisarquivo[1]; + + include_once APPRAIZ. 'includes/simec_funcoes.inc'; + include_once APPRAIZ. 'includes/backtrace/BackTrace.php'; + include_once APPRAIZ. 'includes/backtrace/BackTraceExplain.php'; + include_once APPRAIZ. 'includes/failure/ErrorHandler.php'; + include_once APPRAIZ. 'includes/failure/ExceptionHandler.php'; + include_once APPRAIZ. 'includes/library/simec/SoapClient.php'; + include_once APPRAIZ. "includes/connection/adapter-connection.php"; + + function fechar_conexoes(){ + while( pg_ping()){ + pg_close(); + } + } + register_shutdown_function('fechar_conexoes'); + ErrorHandler::start(); + ExceptionHandler::start(); + ob_start(); + diff --git a/templates/database.erb b/templates/database.erb new file mode 100644 index 0000000..cb4f8cd --- /dev/null +++ b/templates/database.erb @@ -0,0 +1,31 @@ +'; +$servidor_bd = '<%= @db_host %>'; +$porta_bd = '<%= @db_port %>'; +$usuario_db = '<%= @db_username %>'; +$senha_bd = '<%= @db_password %>'; + +# Sistema SIAFI - PRODUO +$servidor_bd_siafi = ''; +$porta_bd_siafi = ''; +$nome_bd_siafi = ''; +$usuario_db_siafi = ''; +$senha_bd_siafi = ''; + +# Sistema PDDEInterativo - PRODUO +$configDbPddeinterativo = new stdClass(); +$configDbPddeinterativo->host = ''; +$configDbPddeinterativo->port = ''; +$configDbPddeinterativo->dbname = ''; +$configDbPddeinterativo->user = ''; +$configDbPddeinterativo->password = ''; + +# Sistema SIGFOR +$configDbSigfor = new stdClass(); +$configDbSigfor->host = ''; +$configDbSigfor->port = ''; +$configDbSigfor->dbname = ''; +$configDbSigfor->user = ''; +$configDbSigfor->password = ''; diff --git a/templates/postgresql.conf.centos.erb b/templates/postgresql.conf.centos.erb new file mode 100644 index 0000000..4a46e63 --- /dev/null +++ b/templates/postgresql.conf.centos.erb @@ -0,0 +1,603 @@ +################################################# +######## Arquivo Gerenciado pelo Puppet ######### +######## !!!!!! NAO EDITE DIRETAMENTE !!!!!!!! ## +######## Edite na paste de templates ############ +################################################# +# ----------------------------- +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. Comments are introduced with +# "#" anywhere on a line. The complete list of parameter names and allowed +# values can be found in the PostgreSQL documentation. +# +# The commented-out settings shown in this file represent the default values. +# Re-commenting a setting is NOT sufficient to revert it to the default value; +# you need to reload the server. +# +# This file is read on server startup and when the server receives a SIGHUP +# signal. If you edit the file on a running system, you have to SIGHUP the +# server for the changes to take effect, or use "pg_ctl reload". Some +# parameters, which are marked below, require a server shutdown and restart to +# take effect. +# +# Any parameter can also be given as a command-line option to the server, e.g., +# "postgres -c log_connections=on". Some parameters can be changed at run time +# with the "SET" SQL command. +# +# Memory units: kB = kilobytes Time units: ms = milliseconds +# MB = megabytes s = seconds +# GB = gigabytes min = minutes +# h = hours +# d = days + + +#------------------------------------------------------------------------------ +# FILE LOCATIONS +#------------------------------------------------------------------------------ + +# The default values of these variables are driven from the -D command-line +# option or PGDATA environment variable, represented here as ConfigDir. + +#data_directory = 'ConfigDir' # use data in another directory + # (change requires restart) +#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file + # (change requires restart) +#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file + # (change requires restart) + +# If external_pid_file is not explicitly set, no extra PID file is written. +#external_pid_file = '' # write an extra PID file + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONNECTIONS AND AUTHENTICATION +#------------------------------------------------------------------------------ + +# - Connection Settings - + +listen_addresses = '*' # what IP address(es) to listen on; + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +port = <%= @db_port %> # (change requires restart) + +max_connections = 100 # (change requires restart) +# Note: Increasing max_connections costs ~400 bytes of shared memory per +# connection slot, plus lock space (see max_locks_per_transaction). +#superuser_reserved_connections = 3 # (change requires restart) +#unix_socket_directories = '/tmp' # comma-separated list of directories + # (change requires restart) +#unix_socket_group = '' # (change requires restart) +#unix_socket_permissions = 0777 # begin with 0 to use octal notation + # (change requires restart) +#bonjour = off # advertise server via Bonjour + # (change requires restart) +#bonjour_name = '' # defaults to the computer name + # (change requires restart) + +# - Security and Authentication - + +#authentication_timeout = 1min # 1s-600s +#ssl = off # (change requires restart) +#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers + # (change requires restart) +#ssl_renegotiation_limit = 0 # amount of data between renegotiations +#ssl_cert_file = 'server.crt' # (change requires restart) +#ssl_key_file = 'server.key' # (change requires restart) +#ssl_ca_file = '' # (change requires restart) +#ssl_crl_file = '' # (change requires restart) +#password_encryption = on +#db_user_namespace = off + +# Kerberos and GSSAPI +#krb_server_keyfile = '' +#krb_srvname = 'postgres' # (Kerberos only) +#krb_caseins_users = off + +# - TCP Keepalives - +# see "man 7 tcp" for details + +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default + + +#------------------------------------------------------------------------------ +# RESOURCE USAGE (except WAL) +#------------------------------------------------------------------------------ + +# - Memory - + +shared_buffers = 128MB # min 128kB + # (change requires restart) +#temp_buffers = 8MB # min 800kB +#max_prepared_transactions = 0 # zero disables the feature + # (change requires restart) +# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory +# per transaction slot, plus lock space (see max_locks_per_transaction). +# It is not advisable to set max_prepared_transactions nonzero unless you +# actively intend to use prepared transactions. +#work_mem = 1MB # min 64kB +#maintenance_work_mem = 16MB # min 1MB +#max_stack_depth = 2MB # min 100kB + +# - Disk - + +#temp_file_limit = -1 # limits per-session temp file space + # in kB, or -1 for no limit + +# - Kernel Resource Usage - + +#max_files_per_process = 1000 # min 25 + # (change requires restart) +#shared_preload_libraries = '' # (change requires restart) + +# - Cost-Based Vacuum Delay - + +#vacuum_cost_delay = 0 # 0-100 milliseconds +#vacuum_cost_page_hit = 1 # 0-10000 credits +#vacuum_cost_page_miss = 10 # 0-10000 credits +#vacuum_cost_page_dirty = 20 # 0-10000 credits +#vacuum_cost_limit = 200 # 1-10000 credits + +# - Background Writer - + +#bgwriter_delay = 200ms # 10-10000ms between rounds +#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round + +# - Asynchronous Behavior - + +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching + + +#------------------------------------------------------------------------------ +# WRITE AHEAD LOG +#------------------------------------------------------------------------------ + +# - Settings - + +#wal_level = minimal # minimal, archive, or hot_standby + # (change requires restart) +#fsync = on # turns forced synchronization on or off +#synchronous_commit = on # synchronization level; + # off, local, remote_write, or on +#wal_sync_method = fsync # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux) + # fsync + # fsync_writethrough + # open_sync +#full_page_writes = on # recover from partial page writes +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +#wal_writer_delay = 200ms # 1-10000 milliseconds + +#commit_delay = 0 # range 0-100000, in microseconds +#commit_siblings = 5 # range 1-1000 + +# - Checkpoints - + +#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each +#checkpoint_timeout = 5min # range 30s-1h +#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 +#checkpoint_warning = 30s # 0 disables + +# - Archiving - + +#archive_mode = off # allows archiving to be done + # (change requires restart) +#archive_command = '' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +#archive_timeout = 0 # force a logfile segment switch after this + # number of seconds; 0 disables + + +#------------------------------------------------------------------------------ +# REPLICATION +#------------------------------------------------------------------------------ + +# - Sending Server(s) - + +# Set these on the master and on any standby that will send replication data. + +#max_wal_senders = 0 # max number of walsender processes + # (change requires restart) +#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables +#wal_sender_timeout = 60s # in milliseconds; 0 disables + +# - Master Server - + +# These settings are ignored on a standby server. + +#synchronous_standby_names = '' # standby servers that provide sync rep + # comma-separated list of application_name + # from standby(s); '*' = all +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed + +# - Standby Servers - + +# These settings are ignored on a master server. + +#hot_standby = off # "on" allows queries during recovery + # (change requires restart) +#max_standby_archive_delay = 30s # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +#max_standby_streaming_delay = 30s # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +#wal_receiver_status_interval = 10s # send replies at least this often + # 0 disables +#hot_standby_feedback = off # send info from standby to prevent + # query conflicts +#wal_receiver_timeout = 60s # time that receiver waits for + # communication from master + # in milliseconds; 0 disables + + +#------------------------------------------------------------------------------ +# QUERY TUNING +#------------------------------------------------------------------------------ + +# - Planner Method Configuration - + +#enable_bitmapscan = on +#enable_hashagg = on +#enable_hashjoin = on +#enable_indexscan = on +#enable_indexonlyscan = on +#enable_material = on +#enable_mergejoin = on +#enable_nestloop = on +#enable_seqscan = on +#enable_sort = on +#enable_tidscan = on + +# - Planner Cost Constants - + +#seq_page_cost = 1.0 # measured on an arbitrary scale +#random_page_cost = 4.0 # same scale as above +#cpu_tuple_cost = 0.01 # same scale as above +#cpu_index_tuple_cost = 0.005 # same scale as above +#cpu_operator_cost = 0.0025 # same scale as above +#effective_cache_size = 128MB + +# - Genetic Query Optimizer - + +#geqo = on +#geqo_threshold = 12 +#geqo_effort = 5 # range 1-10 +#geqo_pool_size = 0 # selects default based on effort +#geqo_generations = 0 # selects default based on effort +#geqo_selection_bias = 2.0 # range 1.5-2.0 +#geqo_seed = 0.0 # range 0.0-1.0 + +# - Other Planner Options - + +#default_statistics_target = 100 # range 1-10000 +#constraint_exclusion = partition # on, off, or partition +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 +#from_collapse_limit = 8 +#join_collapse_limit = 8 # 1 disables collapsing of explicit + # JOIN clauses + + +#------------------------------------------------------------------------------ +# ERROR REPORTING AND LOGGING +#------------------------------------------------------------------------------ + +# - Where to Log - + +log_destination = 'stderr' # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + +# This is used when logging to stderr: +logging_collector = on # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + +# These are only used if logging_collector is on: +log_directory = 'pg_log' # directory where log files are written, + # can be absolute or relative to PGDATA +log_filename = 'postgresql-%a.log' # log file name pattern, + # can include strftime() escapes +#log_file_mode = 0600 # creation mode for log files, + # begin with 0 to use octal notation +log_truncate_on_rotation = on # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. +log_rotation_age = 1d # Automatic rotation of logfiles will + # happen after that time. 0 disables. +log_rotation_size = 0 # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. + +# These are relevant when logging to syslog: +#syslog_facility = 'LOCAL0' +#syslog_ident = 'postgres' + +# This is only relevant when logging to eventlog (win32): +#event_source = 'PostgreSQL' + +# - When to Log - + +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error + +#log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + +#log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + +#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + + +# - What to Log - + +#debug_print_parse = off +#debug_print_rewritten = off +#debug_print_plan = off +#debug_pretty_print = on +#log_checkpoints = off +#log_connections = off +#log_disconnections = off +#log_duration = off +#log_error_verbosity = default # terse, default, or verbose messages +#log_hostname = off +log_line_prefix = '< %m >' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' +#log_lock_waits = off # log lock waits >= deadlock_timeout +#log_statement = 'none' # none, ddl, mod, all +#log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files +log_timezone = 'Brazil/East' + + +#------------------------------------------------------------------------------ +# RUNTIME STATISTICS +#------------------------------------------------------------------------------ + +# - Query/Index Statistics Collector - + +#track_activities = on +#track_counts = on +#track_io_timing = off +#track_functions = none # none, pl, all +#track_activity_query_size = 1024 # (change requires restart) +#update_process_title = on +#stats_temp_directory = 'pg_stat_tmp' + + +# - Statistics Monitoring - + +#log_parser_stats = off +#log_planner_stats = off +#log_executor_stats = off +#log_statement_stats = off + + +#------------------------------------------------------------------------------ +# AUTOVACUUM PARAMETERS +#------------------------------------------------------------------------------ + +#autovacuum = on # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses + # (change requires restart) +#autovacuum_naptime = 1min # time between autovacuum runs +#autovacuum_vacuum_threshold = 50 # min number of row updates before + # vacuum +#autovacuum_analyze_threshold = 50 # min number of row updates before + # analyze +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum + # (change requires restart) +#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age + # before forced vacuum + # (change requires restart) +#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit + + +#------------------------------------------------------------------------------ +# CLIENT CONNECTION DEFAULTS +#------------------------------------------------------------------------------ + +# - Statement Behavior - + +#search_path = '"$user",public' # schema names +#default_tablespace = '' # a tablespace name, '' uses the default +#temp_tablespaces = '' # a list of tablespace names, '' uses + # only default tablespace +#check_function_bodies = on +#default_transaction_isolation = 'read committed' +#default_transaction_read_only = off +#default_transaction_deferrable = off +#session_replication_role = 'origin' +#statement_timeout = 0 # in milliseconds, 0 is disabled +#lock_timeout = 0 # in milliseconds, 0 is disabled +#vacuum_freeze_min_age = 50000000 +#vacuum_freeze_table_age = 150000000 +#vacuum_multixact_freeze_min_age = 5000000 +#vacuum_multixact_freeze_table_age = 150000000 +#bytea_output = 'hex' # hex, escape +#xmlbinary = 'base64' +#xmloption = 'content' +#gin_fuzzy_search_limit = 0 + +# - Locale and Formatting - + +datestyle = 'iso, mdy' +#intervalstyle = 'postgres' +timezone = 'Brazil/East' +#timezone_abbreviations = 'Default' # Select the set of available time zone + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +#extra_float_digits = 0 # min -15, max 3 +#client_encoding = sql_ascii # actually, defaults to database + # encoding + +# These settings are initialized by initdb, but they can be changed. +lc_messages = 'en_US.UTF-8' # locale for system error message + # strings +lc_monetary = 'en_US.UTF-8' # locale for monetary formatting +lc_numeric = 'en_US.UTF-8' # locale for number formatting +lc_time = 'en_US.UTF-8' # locale for time formatting + +# default configuration for text search +default_text_search_config = 'pg_catalog.english' + +# - Other Defaults - + +#dynamic_library_path = '$libdir' +#local_preload_libraries = '' + + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +#deadlock_timeout = 1s +#max_locks_per_transaction = 64 # min 10 + # (change requires restart) +# Note: Each lock table slot uses ~270 bytes of shared memory, and there are +# max_locks_per_transaction * (max_connections + max_prepared_transactions) +# lock table slots. +#max_pred_locks_per_transaction = 64 # min 10 + # (change requires restart) + + +#------------------------------------------------------------------------------ +# VERSION/PLATFORM COMPATIBILITY +#------------------------------------------------------------------------------ + +# - Previous PostgreSQL Versions - + +#array_nulls = on +#backslash_quote = safe_encoding # on, off, or safe_encoding +#default_with_oids = off +#escape_string_warning = on +#lo_compat_privileges = off +#quote_all_identifiers = off +#sql_inheritance = on +#standard_conforming_strings = on +#synchronize_seqscans = on + +# - Other Platforms and Clients - + +#transform_null_equals = off + + +#------------------------------------------------------------------------------ +# ERROR HANDLING +#------------------------------------------------------------------------------ + +#exit_on_error = off # terminate session on any error? +#restart_after_crash = on # reinitialize after backend crash? + + +#------------------------------------------------------------------------------ +# CONFIG FILE INCLUDES +#------------------------------------------------------------------------------ + +# These options allow settings to be loaded from files other than the +# default postgresql.conf. + +#include_dir = 'conf.d' # include files ending in '.conf' from + # directory 'conf.d' +#include_if_exists = 'exists.conf' # include file only if it exists +#include = 'special.conf' # include file + + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +# Add settings for extensions here diff --git a/templates/postgresql.conf.debian.erb b/templates/postgresql.conf.debian.erb new file mode 100644 index 0000000..c7618c1 --- /dev/null +++ b/templates/postgresql.conf.debian.erb @@ -0,0 +1,602 @@ +################################################# +######## Arquivo Gerenciado pelo Puppet ######### +######## !!!!!! NAO EDITE DIRETAMENTE !!!!!!!! ## +######## Edite na paste de templates ############ +################################################# +# ----------------------------- +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. Comments are introduced with +# "#" anywhere on a line. The complete list of parameter names and allowed +# values can be found in the PostgreSQL documentation. +# +# The commented-out settings shown in this file represent the default values. +# Re-commenting a setting is NOT sufficient to revert it to the default value; +# you need to reload the server. +# +# This file is read on server startup and when the server receives a SIGHUP +# signal. If you edit the file on a running system, you have to SIGHUP the +# server for the changes to take effect, or use "pg_ctl reload". Some +# parameters, which are marked below, require a server shutdown and restart to +# take effect. +# +# Any parameter can also be given as a command-line option to the server, e.g., +# "postgres -c log_connections=on". Some parameters can be changed at run time +# with the "SET" SQL command. +# +# Memory units: kB = kilobytes Time units: ms = milliseconds +# MB = megabytes s = seconds +# GB = gigabytes min = minutes +# h = hours +# d = days + + +#------------------------------------------------------------------------------ +# FILE LOCATIONS +#------------------------------------------------------------------------------ + +# The default values of these variables are driven from the -D command-line +# option or PGDATA environment variable, represented here as ConfigDir. + +data_directory = '/var/lib/postgresql/9.3/main' # use data in another directory + # (change requires restart) +hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file + # (change requires restart) +ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file + # (change requires restart) + +# If external_pid_file is not explicitly set, no extra PID file is written. +external_pid_file = '/var/run/postgresql/9.3-main.pid' # write an extra PID file + # (change requires restart) + + +#------------------------------------------------------------------------------ +# CONNECTIONS AND AUTHENTICATION +#------------------------------------------------------------------------------ + +# - Connection Settings - + +listen_addresses = '*' # what IP address(es) to listen on; + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +port = <%= @db_port %> # (change requires restart) +max_connections = 100 # (change requires restart) +# Note: Increasing max_connections costs ~400 bytes of shared memory per +# connection slot, plus lock space (see max_locks_per_transaction). +#superuser_reserved_connections = 3 # (change requires restart) +unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories + # (change requires restart) +#unix_socket_group = '' # (change requires restart) +#unix_socket_permissions = 0777 # begin with 0 to use octal notation + # (change requires restart) +#bonjour = off # advertise server via Bonjour + # (change requires restart) +#bonjour_name = '' # defaults to the computer name + # (change requires restart) + +# - Security and Authentication - + +#authentication_timeout = 1min # 1s-600s +ssl = true # (change requires restart) +#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers + # (change requires restart) +#ssl_renegotiation_limit = 0 # amount of data between renegotiations +ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) +ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) +#ssl_ca_file = '' # (change requires restart) +#ssl_crl_file = '' # (change requires restart) +#password_encryption = on +#db_user_namespace = off + +# Kerberos and GSSAPI +#krb_server_keyfile = '' +#krb_srvname = 'postgres' # (Kerberos only) +#krb_caseins_users = off + +# - TCP Keepalives - +# see "man 7 tcp" for details + +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default + + +#------------------------------------------------------------------------------ +# RESOURCE USAGE (except WAL) +#------------------------------------------------------------------------------ + +# - Memory - + +shared_buffers = 128MB # min 128kB + # (change requires restart) +#temp_buffers = 8MB # min 800kB +#max_prepared_transactions = 0 # zero disables the feature + # (change requires restart) +# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory +# per transaction slot, plus lock space (see max_locks_per_transaction). +# It is not advisable to set max_prepared_transactions nonzero unless you +# actively intend to use prepared transactions. +#work_mem = 1MB # min 64kB +#maintenance_work_mem = 16MB # min 1MB +#max_stack_depth = 2MB # min 100kB + +# - Disk - + +#temp_file_limit = -1 # limits per-session temp file space + # in kB, or -1 for no limit + +# - Kernel Resource Usage - + +#max_files_per_process = 1000 # min 25 + # (change requires restart) +#shared_preload_libraries = '' # (change requires restart) + +# - Cost-Based Vacuum Delay - + +#vacuum_cost_delay = 0 # 0-100 milliseconds +#vacuum_cost_page_hit = 1 # 0-10000 credits +#vacuum_cost_page_miss = 10 # 0-10000 credits +#vacuum_cost_page_dirty = 20 # 0-10000 credits +#vacuum_cost_limit = 200 # 1-10000 credits + +# - Background Writer - + +#bgwriter_delay = 200ms # 10-10000ms between rounds +#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round + +# - Asynchronous Behavior - + +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching + + +#------------------------------------------------------------------------------ +# WRITE AHEAD LOG +#------------------------------------------------------------------------------ + +# - Settings - + +#wal_level = minimal # minimal, archive, or hot_standby + # (change requires restart) +#fsync = on # turns forced synchronization on or off +#synchronous_commit = on # synchronization level; + # off, local, remote_write, or on +#wal_sync_method = fsync # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux) + # fsync + # fsync_writethrough + # open_sync +#full_page_writes = on # recover from partial page writes +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +#wal_writer_delay = 200ms # 1-10000 milliseconds + +#commit_delay = 0 # range 0-100000, in microseconds +#commit_siblings = 5 # range 1-1000 + +# - Checkpoints - + +#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each +#checkpoint_timeout = 5min # range 30s-1h +#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 +#checkpoint_warning = 30s # 0 disables + +# - Archiving - + +#archive_mode = off # allows archiving to be done + # (change requires restart) +#archive_command = '' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +#archive_timeout = 0 # force a logfile segment switch after this + # number of seconds; 0 disables + + +#------------------------------------------------------------------------------ +# REPLICATION +#------------------------------------------------------------------------------ + +# - Sending Server(s) - + +# Set these on the master and on any standby that will send replication data. + +#max_wal_senders = 0 # max number of walsender processes + # (change requires restart) +#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables +#wal_sender_timeout = 60s # in milliseconds; 0 disables + +# - Master Server - + +# These settings are ignored on a standby server. + +#synchronous_standby_names = '' # standby servers that provide sync rep + # comma-separated list of application_name + # from standby(s); '*' = all +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed + +# - Standby Servers - + +# These settings are ignored on a master server. + +#hot_standby = off # "on" allows queries during recovery + # (change requires restart) +#max_standby_archive_delay = 30s # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +#max_standby_streaming_delay = 30s # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +#wal_receiver_status_interval = 10s # send replies at least this often + # 0 disables +#hot_standby_feedback = off # send info from standby to prevent + # query conflicts +#wal_receiver_timeout = 60s # time that receiver waits for + # communication from master + # in milliseconds; 0 disables + + +#------------------------------------------------------------------------------ +# QUERY TUNING +#------------------------------------------------------------------------------ + +# - Planner Method Configuration - + +#enable_bitmapscan = on +#enable_hashagg = on +#enable_hashjoin = on +#enable_indexscan = on +#enable_indexonlyscan = on +#enable_material = on +#enable_mergejoin = on +#enable_nestloop = on +#enable_seqscan = on +#enable_sort = on +#enable_tidscan = on + +# - Planner Cost Constants - + +#seq_page_cost = 1.0 # measured on an arbitrary scale +#random_page_cost = 4.0 # same scale as above +#cpu_tuple_cost = 0.01 # same scale as above +#cpu_index_tuple_cost = 0.005 # same scale as above +#cpu_operator_cost = 0.0025 # same scale as above +#effective_cache_size = 128MB + +# - Genetic Query Optimizer - + +#geqo = on +#geqo_threshold = 12 +#geqo_effort = 5 # range 1-10 +#geqo_pool_size = 0 # selects default based on effort +#geqo_generations = 0 # selects default based on effort +#geqo_selection_bias = 2.0 # range 1.5-2.0 +#geqo_seed = 0.0 # range 0.0-1.0 + +# - Other Planner Options - + +#default_statistics_target = 100 # range 1-10000 +#constraint_exclusion = partition # on, off, or partition +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 +#from_collapse_limit = 8 +#join_collapse_limit = 8 # 1 disables collapsing of explicit + # JOIN clauses + + +#------------------------------------------------------------------------------ +# ERROR REPORTING AND LOGGING +#------------------------------------------------------------------------------ + +# - Where to Log - + +#log_destination = 'stderr' # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + +# This is used when logging to stderr: +#logging_collector = off # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + +# These are only used if logging_collector is on: +#log_directory = 'pg_log' # directory where log files are written, + # can be absolute or relative to PGDATA +#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, + # can include strftime() escapes +#log_file_mode = 0600 # creation mode for log files, + # begin with 0 to use octal notation +#log_truncate_on_rotation = off # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. +#log_rotation_age = 1d # Automatic rotation of logfiles will + # happen after that time. 0 disables. +#log_rotation_size = 10MB # Automatic rotation of logfiles will + # happen after that much log output. + # 0 disables. + +# These are relevant when logging to syslog: +#syslog_facility = 'LOCAL0' +#syslog_ident = 'postgres' + +# This is only relevant when logging to eventlog (win32): +#event_source = 'PostgreSQL' + +# - When to Log - + +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error + +#log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + +#log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + +#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + + +# - What to Log - + +#debug_print_parse = off +#debug_print_rewritten = off +#debug_print_plan = off +#debug_pretty_print = on +#log_checkpoints = off +#log_connections = off +#log_disconnections = off +#log_duration = off +#log_error_verbosity = default # terse, default, or verbose messages +#log_hostname = off +log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' +#log_lock_waits = off # log lock waits >= deadlock_timeout +#log_statement = 'none' # none, ddl, mod, all +#log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files +log_timezone = 'UTC' + + +#------------------------------------------------------------------------------ +# RUNTIME STATISTICS +#------------------------------------------------------------------------------ + +# - Query/Index Statistics Collector - + +#track_activities = on +#track_counts = on +#track_io_timing = off +#track_functions = none # none, pl, all +#track_activity_query_size = 1024 # (change requires restart) +#update_process_title = on +stats_temp_directory = '/var/run/postgresql/9.3-main.pg_stat_tmp' + + +# - Statistics Monitoring - + +#log_parser_stats = off +#log_planner_stats = off +#log_executor_stats = off +#log_statement_stats = off + + +#------------------------------------------------------------------------------ +# AUTOVACUUM PARAMETERS +#------------------------------------------------------------------------------ + +#autovacuum = on # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses + # (change requires restart) +#autovacuum_naptime = 1min # time between autovacuum runs +#autovacuum_vacuum_threshold = 50 # min number of row updates before + # vacuum +#autovacuum_analyze_threshold = 50 # min number of row updates before + # analyze +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum + # (change requires restart) +#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age + # before forced vacuum + # (change requires restart) +#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit + + +#------------------------------------------------------------------------------ +# CLIENT CONNECTION DEFAULTS +#------------------------------------------------------------------------------ + +# - Statement Behavior - + +#search_path = '"$user",public' # schema names +#default_tablespace = '' # a tablespace name, '' uses the default +#temp_tablespaces = '' # a list of tablespace names, '' uses + # only default tablespace +#check_function_bodies = on +#default_transaction_isolation = 'read committed' +#default_transaction_read_only = off +#default_transaction_deferrable = off +#session_replication_role = 'origin' +#statement_timeout = 0 # in milliseconds, 0 is disabled +#lock_timeout = 0 # in milliseconds, 0 is disabled +#vacuum_freeze_min_age = 50000000 +#vacuum_freeze_table_age = 150000000 +#vacuum_multixact_freeze_min_age = 5000000 +#vacuum_multixact_freeze_table_age = 150000000 +#bytea_output = 'hex' # hex, escape +#xmlbinary = 'base64' +#xmloption = 'content' +#gin_fuzzy_search_limit = 0 + +# - Locale and Formatting - + +datestyle = 'iso, mdy' +#intervalstyle = 'postgres' +timezone = 'UTC' +#timezone_abbreviations = 'Default' # Select the set of available time zone + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +#extra_float_digits = 0 # min -15, max 3 +#client_encoding = sql_ascii # actually, defaults to database + # encoding + +# These settings are initialized by initdb, but they can be changed. +lc_messages = 'en_US.UTF-8' # locale for system error message + # strings +lc_monetary = 'en_US.UTF-8' # locale for monetary formatting +lc_numeric = 'en_US.UTF-8' # locale for number formatting +lc_time = 'en_US.UTF-8' # locale for time formatting + +# default configuration for text search +default_text_search_config = 'pg_catalog.english' + +# - Other Defaults - + +#dynamic_library_path = '$libdir' +#local_preload_libraries = '' + + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +#deadlock_timeout = 1s +#max_locks_per_transaction = 64 # min 10 + # (change requires restart) +# Note: Each lock table slot uses ~270 bytes of shared memory, and there are +# max_locks_per_transaction * (max_connections + max_prepared_transactions) +# lock table slots. +#max_pred_locks_per_transaction = 64 # min 10 + # (change requires restart) + + +#------------------------------------------------------------------------------ +# VERSION/PLATFORM COMPATIBILITY +#------------------------------------------------------------------------------ + +# - Previous PostgreSQL Versions - + +#array_nulls = on +#backslash_quote = safe_encoding # on, off, or safe_encoding +#default_with_oids = off +#escape_string_warning = on +#lo_compat_privileges = off +#quote_all_identifiers = off +#sql_inheritance = on +#standard_conforming_strings = on +#synchronize_seqscans = on + +# - Other Platforms and Clients - + +#transform_null_equals = off + + +#------------------------------------------------------------------------------ +# ERROR HANDLING +#------------------------------------------------------------------------------ + +#exit_on_error = off # terminate session on any error? +#restart_after_crash = on # reinitialize after backend crash? + + +#------------------------------------------------------------------------------ +# CONFIG FILE INCLUDES +#------------------------------------------------------------------------------ + +# These options allow settings to be loaded from files other than the +# default postgresql.conf. + +#include_dir = 'conf.d' # include files ending in '.conf' from + # directory 'conf.d' +#include_if_exists = 'exists.conf' # include file only if it exists +#include = 'special.conf' # include file + + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +# Add settings for extensions here diff --git a/tests/init.pp b/tests/init.pp new file mode 100644 index 0000000..2a0b345 --- /dev/null +++ b/tests/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# http://docs.puppetlabs.com/guides/tests_smoke.html +# +include simec -- libgit2 0.21.2