Commit 8ba19d2357889e167b7a377fdb72267ff6e38516
1 parent
f1a50848
Exists in
master
Inserindo arquivos do módulo de instalação do SIMEC via PUPPET
Showing
19 changed files
with
2076 additions
and
57 deletions
Show diff stats
README.md
1 | -# Simec - Sistema Integrado de Monitoramento, Execução e Controle | |
1 | +# Simec - Sistema Integrado de Monitoramento, Execução e Controle | |
2 | 2 | |
3 | -#### Tabela de Conteúdo | |
3 | +#### Tabela de Conteúdo | |
4 | 4 | |
5 | 5 | 1. [Sobre](#sobre) |
6 | 6 | 2. [Compatibilidade](#compatibilidade) |
... | ... | @@ -9,36 +9,36 @@ |
9 | 9 | 5. [ServerLess](#serverless) |
10 | 10 | 6. [Uso](#uso) |
11 | 11 | 7. [Classes](#classes) |
12 | -8. [Parâmetros](#parametros) | |
12 | +8. [Parâmetros](#parametros) | |
13 | 13 | 9. [Acesso](#acesso) |
14 | 14 | 10. [Pendente](#pendente) |
15 | -11. [Referências](#referencias) | |
15 | +11. [Referências](#referencias) | |
16 | 16 | |
17 | 17 | ## Sobre |
18 | 18 | |
19 | -O SIMEC é uma ferramenta web escrita em linguagem PHP e com servidor de banco de dados | |
20 | -PostgreSQL. O sistema em PHP é responsável pela lógica do servidor com interfaces do lado do | |
21 | -cliente escritas em Javascript, enquanto o PostgreSQL faz o papel de repositório de dados. | |
19 | +O SIMEC é uma ferramenta web escrita em linguagem PHP e com servidor de banco de dados | |
20 | +PostgreSQL. O sistema em PHP é responsável pela lógica do servidor com interfaces do lado do | |
21 | +cliente escritas em Javascript, enquanto o PostgreSQL faz o papel de repositório de dados. | |
22 | 22 | |
23 | -Esse módulo pode instalar e configurar o Apache, baixar o código de um repositório remoto, instalar | |
23 | +Esse módulo pode instalar e configurar o Apache, baixar o código de um repositório remoto, instalar | |
24 | 24 | o banco de dados PostgresSQL localmente ou configurar o acesso a um banco remoto. |
25 | 25 | |
26 | 26 | ## Compatibilidade |
27 | 27 | |
28 | - * Compatível com CentOS 7 e Debian >= 7 | |
28 | + * CompatÃvel com CentOS 7 e Debian >= 7 | |
29 | 29 | * Escrito com recursos do Puppet 3. |
30 | 30 | * O Simec utiliza APACHE 2 e PostgreSQL 8.4 ou superior. |
31 | - * Este módulo usa **PostgreSQL 9.3.** | |
31 | + * Este módulo usa **PostgreSQL 9.3.** | |
32 | 32 | |
33 | 33 | ## Requisitos |
34 | 34 | |
35 | 35 | * Pelo menos 2 gigas de RAM |
36 | 36 | * Pelo menos 10 gigas de disco |
37 | - * Acesso a internet para instalação de pacotes | |
37 | + * Acesso a internet para instalação de pacotes | |
38 | 38 | |
39 | 39 | ## Setup **Install Puppet** |
40 | 40 | |
41 | -Instale o repositório do puppet para o seu Sistema Operacional. | |
41 | +Instale o repositório do puppet para o seu Sistema Operacional. | |
42 | 42 | |
43 | 43 | Debian |
44 | 44 | $ wget https://apt.puppetlabs.com/puppetlabs-release-stable.deb |
... | ... | @@ -50,7 +50,7 @@ Instale o repositório do puppet para o seu Sistema Operacional. |
50 | 50 | $ sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm |
51 | 51 | # yum install puppet-agent |
52 | 52 | |
53 | -Em caso de instalações ServerLess, será preciso instalar o módulo no diretório de módulos de acordo com o S.O. | |
53 | +Em caso de instalações ServerLess, será preciso instalar o módulo no diretório de módulos de acordo com o S.O. | |
54 | 54 | |
55 | 55 | Gerelamente no Debian: |
56 | 56 | |
... | ... | @@ -70,20 +70,20 @@ Dependendo do Sistema Operacional. |
70 | 70 | |
71 | 71 | ## ServerLess |
72 | 72 | |
73 | -Após criar o manifest, execute o puppet em modo serverless. (obs.: é necessário | |
74 | -instalar os módulos de dependência.) | |
73 | +Após criar o manifest, execute o puppet em modo serverless. (obs.: é necessário | |
74 | +instalar os módulos de dependência.) | |
75 | 75 | |
76 | 76 | # puppet module install puppetlabs-vcsrepo |
77 | 77 | # puppet module install puppetlabs-apache |
78 | 78 | # puppet module install herculesteam-augeasproviders_postgresql |
79 | 79 | # puppet apply /tmp/meusimec.pp |
80 | 80 | |
81 | -obs.: /tmp/meusimec.pp é o arquivo com a declaração da classe (Veja mais em [Uso](#uso)). | |
81 | +obs.: /tmp/meusimec.pp é o arquivo com a declaração da classe (Veja mais em [Uso](#uso)). | |
82 | 82 | |
83 | 83 | |
84 | 84 | ## Uso |
85 | 85 | |
86 | -Para instalar o SIMEC com banco local (o padrão é banco remoto) e parâmetros padrões: | |
86 | +Para instalar o SIMEC com banco local (o padrão é banco remoto) e parâmetros padrões: | |
87 | 87 | |
88 | 88 | ```puppet |
89 | 89 | class { '::simec': |
... | ... | @@ -104,8 +104,8 @@ class {'::simec': |
104 | 104 | } |
105 | 105 | ``` |
106 | 106 | |
107 | -Para especificar um repositório, DocumentRoot e um sistema de controle de versão diferente do git, use: | |
108 | -(obs.: é necessário um repositório com permissão de clone (git) ou chekout (svn) sem exigir autenticação.) | |
107 | +Para especificar um repositório, DocumentRoot e um sistema de controle de versão diferente do git, use: | |
108 | +(obs.: é necessário um repositório com permissão de clone (git) ou chekout (svn) sem exigir autenticação.) | |
109 | 109 | |
110 | 110 | ```puppet |
111 | 111 | class {'::simec': |
... | ... | @@ -115,7 +115,7 @@ class {'::simec': |
115 | 115 | vcsprovider => 'svn' |
116 | 116 | } |
117 | 117 | ``` |
118 | -Exemplo de uma declaração com TODOS os parâmetros: | |
118 | +Exemplo de uma declaração com TODOS os parâmetros: | |
119 | 119 | |
120 | 120 | ```puppet |
121 | 121 | class {'::simec': |
... | ... | @@ -141,129 +141,129 @@ class {'::simec': |
141 | 141 | |
142 | 142 | #### Classe simec::apache |
143 | 143 | |
144 | - * Instalação e configuração do Apache | |
145 | - * Módulos do Apache | |
146 | - * Configuração do Vhost com Aliases, etc. | |
147 | - * Configuração do Parâmetros do PHP no Vhost via php_value e php_admin. | |
144 | + * Instalação e configuração do Apache | |
145 | + * Módulos do Apache | |
146 | + * Configuração do Vhost com Aliases, etc. | |
147 | + * Configuração do Parâmetros do PHP no Vhost via php_value e php_admin. | |
148 | 148 | |
149 | 149 | #### Classe simec::postgresql |
150 | 150 | |
151 | - * Instalação do Servidor PostgreSQL. | |
152 | - * Configuração do Repositório oficial do PostgreSQL. | |
153 | - * Instalação dos pacotes do PostGis (GeoProcessamento). | |
154 | - * Criação da Base de Dados. | |
155 | - * Configuração do pg_hba.conf. | |
151 | + * Instalação do Servidor PostgreSQL. | |
152 | + * Configuração do Repositório oficial do PostgreSQL. | |
153 | + * Instalação dos pacotes do PostGis (GeoProcessamento). | |
154 | + * Criação da Base de Dados. | |
155 | + * Configuração do pg_hba.conf. | |
156 | 156 | * Restore do Dump da Base de Dados. |
157 | 157 | |
158 | 158 | #### Classe simec::install |
159 | 159 | |
160 | - * Instalação dos Pacotes php. | |
161 | - * Instalação do Pacote do Provider para o VCSREPO (Controle de versionamento, git, svn, etc.). | |
162 | - * Clone, etc. do Repositório com o código do SIMEC para o $datadir definido. | |
160 | + * Instalação dos Pacotes php. | |
161 | + * Instalação do Pacote do Provider para o VCSREPO (Controle de versionamento, git, svn, etc.). | |
162 | + * Clone, etc. do Repositório com o código do SIMEC para o $datadir definido. | |
163 | 163 | |
164 | 164 | #### Classe simec::config |
165 | 165 | |
166 | - * Configuração dos arquivos do SIMEC via Template ERB. | |
166 | + * Configuração dos arquivos do SIMEC via Template ERB. | |
167 | 167 | * Arquivo principal do simec (config.inc). |
168 | - * Arquivo de Configuração para conexão com o Banco (database.php). | |
168 | + * Arquivo de Configuração para conexão com o Banco (database.php). | |
169 | 169 | |
170 | 170 | #### Classe simec::params |
171 | 171 | |
172 | - * Configuração dos parâmetros padrões. | |
173 | - * Definição do $apacheuser de acordo com o facter osfamily (RedHat e Debian). | |
174 | - * Definição dos pacotes a serem instalados. | |
172 | + * Configuração dos parâmetros padrões. | |
173 | + * Definição do $apacheuser de acordo com o facter osfamily (RedHat e Debian). | |
174 | + * Definição dos pacotes a serem instalados. | |
175 | 175 | |
176 | 176 | #### Classe simec:init |
177 | 177 | |
178 | 178 | * Classe principal para saber como chamar (Veja mais em [Uso](#uso)). |
179 | - * Verificação do valor da variável $instal_db para decidir se há necessidade de instalação do banco localmente ou não. | |
179 | + * Verificação do valor da variável $instal_db para decidir se há necessidade de instalação do banco localmente ou não. | |
180 | 180 | |
181 | -## Parâmetros | |
181 | +## Parâmetros | |
182 | 182 | |
183 | -### Informações do Parâmetros | |
183 | +### Informações do Parâmetros | |
184 | 184 | |
185 | 185 | [**vhost**] |
186 | 186 | |
187 | -Domínio que será configurado no vhost ex.: simec.seudominio.gov. **Valor Padrão: simec.dominio.gov.br** | |
187 | +DomÃnio que será configurado no vhost ex.: simec.seudominio.gov. **Valor Padrão: simec.dominio.gov.br** | |
188 | 188 | |
189 | 189 | |
190 | 190 | |
191 | 191 | [**datadir**] |
192 | 192 | |
193 | -Local em que o código será baixado e serão feitos os apontamentos no vhost. **Valor Padrão: /var/www/html/simec** | |
193 | +Local em que o código será baixado e serão feitos os apontamentos no vhost. **Valor Padrão: /var/www/html/simec** | |
194 | 194 | |
195 | 195 | |
196 | 196 | |
197 | 197 | [**apacheuser**] |
198 | 198 | |
199 | -Usuário do serviço apache, definido automaticamente pelo facter osfamily caso seja RedHat ou Debian | |
199 | +Usuário do serviço apache, definido automaticamente pelo facter osfamily caso seja RedHat ou Debian | |
200 | 200 | |
201 | 201 | |
202 | 202 | |
203 | 203 | [**db_username**] |
204 | 204 | |
205 | -Nome do usuário de conexão com o banco de dados. **Valor Padrão: user_simec** | |
205 | +Nome do usuário de conexão com o banco de dados. **Valor Padrão: user_simec** | |
206 | 206 | |
207 | 207 | |
208 | 208 | |
209 | 209 | [**db_password**] |
210 | 210 | |
211 | -Senha de conexão com o banco de dados. **Valor Padrão: 841j8K9J67p788x** | |
211 | +Senha de conexão com o banco de dados. **Valor Padrão: 841j8K9J67p788x** | |
212 | 212 | |
213 | 213 | |
214 | 214 | |
215 | 215 | [**db_name**] |
216 | 216 | |
217 | -Nome da base de dados. **Valor Padrão: db_simec** | |
217 | +Nome da base de dados. **Valor Padrão: db_simec** | |
218 | 218 | |
219 | 219 | |
220 | 220 | |
221 | 221 | [**db_host**] |
222 | 222 | |
223 | -IP ou nome do servidor de banco de dados. **Valor Padrão: $::ipaddress** | |
223 | +IP ou nome do servidor de banco de dados. **Valor Padrão: $::ipaddress** | |
224 | 224 | |
225 | 225 | |
226 | 226 | |
227 | 227 | [**db_port**] |
228 | 228 | |
229 | -Porta de Conexão com o servidor de banco de dados. **Valor Padrão: 5432** | |
229 | +Porta de Conexão com o servidor de banco de dados. **Valor Padrão: 5432** | |
230 | 230 | |
231 | 231 | |
232 | 232 | |
233 | 233 | [**vcsprovider**] |
234 | 234 | |
235 | -Pacote do Sistema de Controle de Versionamento. **Valor Padrão: git** | |
235 | +Pacote do Sistema de Controle de Versionamento. **Valor Padrão: git** | |
236 | 236 | |
237 | 237 | |
238 | 238 | |
239 | 239 | [**repoensure**] |
240 | 240 | |
241 | -Definição se será realizado o download do código via VCSREPO. **Valor Padrão: present** (Fazer Download) | |
241 | +Definição se será realizado o download do código via VCSREPO. **Valor Padrão: present** (Fazer Download) | |
242 | 242 | |
243 | 243 | |
244 | 244 | |
245 | 245 | [**source**] |
246 | 246 | |
247 | -URL do Repositório do código. **Valor padrão: https://softwarepublico.gov.br/gitlab/simec/simec.git** | |
247 | +URL do Repositório do código. **Valor padrão: https://softwarepublico.gov.br/gitlab/simec/simec.git** | |
248 | 248 | |
249 | 249 | |
250 | 250 | |
251 | 251 | [**emails**] |
252 | 252 | |
253 | -Emails configurados no arquivo de configuração principal do SIMEC config.inc para receber informações do sistema. | |
253 | +Emails configurados no arquivo de configuração principal do SIMEC config.inc para receber informações do sistema. | |
254 | 254 | |
255 | 255 | |
256 | 256 | |
257 | 257 | [**install_db**] |
258 | 258 | |
259 | -Variável booleana para definir se será instalado o banco de dados localmente. **Valor Padrão: false** | |
259 | +Variável booleana para definir se será instalado o banco de dados localmente. **Valor Padrão: false** | |
260 | 260 | |
261 | 261 | |
262 | 262 | ### Acesso |
263 | 263 | |
264 | -Sistema instalado e o apontamento no DNS para o domínio escolhido ($vhost) ao menos na máquina com o navegador. | |
264 | +Sistema instalado e o apontamento no DNS para o domÃnio escolhido ($vhost) ao menos na máquina com o navegador. | |
265 | 265 | |
266 | -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. | |
266 | +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. | |
267 | 267 | |
268 | 268 | |
269 | 269 | |
... | ... | @@ -275,8 +275,8 @@ Acesso administrativo: |
275 | 275 | |
276 | 276 | ### Pendente |
277 | 277 | |
278 | -Configuração do módulo para outros Sistemas Operacionais. | |
278 | +Configuração do módulo para outros Sistemas Operacionais. | |
279 | 279 | |
280 | -### Referências | |
280 | +### Referências | |
281 | 281 | * https://softwarepublico.gov.br/social/simec/ |
282 | 282 | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +require 'rubygems' | |
2 | +require 'puppetlabs_spec_helper/rake_tasks' | |
3 | +require 'puppet-lint/tasks/puppet-lint' | |
4 | +PuppetLint.configuration.send('disable_80chars') | |
5 | +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] | |
6 | + | |
7 | +desc "Validate manifests, templates, and ruby files" | |
8 | +task :validate do | |
9 | + Dir['manifests/**/*.pp'].each do |manifest| | |
10 | + sh "puppet parser validate --noop #{manifest}" | |
11 | + end | |
12 | + Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| | |
13 | + sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ | |
14 | + end | |
15 | + Dir['templates/**/*.erb'].each do |template| | |
16 | + sh "erb -P -x -T '-' #{template} | ruby -c" | |
17 | + end | |
18 | +end | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +class {'::simec': | |
2 | + vhost => 'meusimec.dominio', | |
3 | + source => 'http://repositoriodosimec', | |
4 | + datadir => '/var/www/html/simec', | |
5 | + install_db => true, | |
6 | + db_name => 'dbsimec', | |
7 | + db_username => 'usrsimec', | |
8 | + db_password => 'MinhaSenhaForte', | |
9 | + db_port => '5432', | |
10 | + emails => 'meuemail@meudominio ; outroemail@outrodominio', | |
11 | + vcsprovider => 'git', | |
12 | + apacheuser => 'apache', | |
13 | + repoensure => 'present' | |
14 | +} | ... | ... |
... | ... | @@ -0,0 +1,166 @@ |
1 | +#!/bin/sh | |
2 | + | |
3 | +# script to add apt.postgresql.org to sources.list | |
4 | + | |
5 | +# from command line | |
6 | +CODENAME="$1" | |
7 | +# lsb_release is the best interface, but not always available | |
8 | +if [ -z "$CODENAME" ]; then | |
9 | + CODENAME=$(lsb_release -cs 2>/dev/null) | |
10 | +fi | |
11 | +# parse os-release (unreliable, does not work on Ubuntu) | |
12 | +if [ -z "$CODENAME" -a -f /etc/os-release ]; then | |
13 | + . /etc/os-release | |
14 | + # Debian: VERSION="7.0 (wheezy)" | |
15 | + # Ubuntu: VERSION="13.04, Raring Ringtail" | |
16 | + CODENAME=$(echo $VERSION | sed -ne 's/.*(\(.*\)).*/\1/') | |
17 | +fi | |
18 | +# guess from sources.list | |
19 | +if [ -z "$CODENAME" ]; then | |
20 | + CODENAME=$(grep '^deb ' /etc/apt/sources.list | head -n1 | awk '{ print $3 }') | |
21 | +fi | |
22 | +# complain if no result yet | |
23 | +if [ -z "$CODENAME" ]; then | |
24 | + cat <<EOF | |
25 | +Could not determine the distribution codename. Please report this as a bug to | |
26 | +pgsql-pkg-debian@postgresql.org. As a workaround, you can call this script with | |
27 | +the proper codename as parameter, e.g. "$0 squeeze". | |
28 | +EOF | |
29 | + exit 1 | |
30 | +fi | |
31 | + | |
32 | +# errors are non-fatal above | |
33 | +set -e | |
34 | + | |
35 | +cat <<EOF | |
36 | +This script will enable the PostgreSQL APT repository on apt.postgresql.org on | |
37 | +your system. The distribution codename used will be $CODENAME-pgdg. | |
38 | + | |
39 | +EOF | |
40 | + | |
41 | +case $CODENAME in | |
42 | + # known distributions | |
43 | + sid|jessie|wheezy|squeeze|lenny|etch) ;; | |
44 | + xenial|wily|trusty|precise|lucid) ;; | |
45 | + *) # unknown distribution, verify on the web | |
46 | + DISTURL="http://apt.postgresql.org/pub/repos/apt/dists/" | |
47 | + if [ -x /usr/bin/curl ]; then | |
48 | + DISTHTML=$(curl -s $DISTURL) | |
49 | + elif [ -x /usr/bin/wget ]; then | |
50 | + DISTHTML=$(wget --quiet -O - $DISTURL) | |
51 | + fi | |
52 | + if [ "$DISTHTML" ]; then | |
53 | + if ! echo "$DISTHTML" | grep -q "$CODENAME-pgdg"; then | |
54 | + cat <<EOF | |
55 | +Your system is using the distribution codename $CODENAME, but $CODENAME-pgdg | |
56 | +does not seem to be a valid distribution on | |
57 | +$DISTURL | |
58 | + | |
59 | +We abort the installation here. If you want to use a distribution different | |
60 | +from your system, you can call this script with an explicit codename, e.g. | |
61 | +"$0 precise". | |
62 | + | |
63 | +Specifically, if you are using a non-LTS Ubuntu release, refer to | |
64 | +https://wiki.postgresql.org/wiki/Apt/FAQ#I_am_using_a_non-LTS_release_of_Ubuntu | |
65 | + | |
66 | +For more information, refer to https://wiki.postgresql.org/wiki/Apt | |
67 | +or ask on the mailing list for assistance: pgsql-pkg-debian@postgresql.org | |
68 | +EOF | |
69 | + exit 1 | |
70 | + fi | |
71 | + fi | |
72 | + ;; | |
73 | +esac | |
74 | + | |
75 | +echo -n "Press Enter to continue, or Ctrl-C to abort." | |
76 | + | |
77 | +#read enter | |
78 | + | |
79 | +echo "Writing /etc/apt/sources.list.d/pgdg.list ..." | |
80 | +cat > /etc/apt/sources.list.d/pgdg.list <<EOF | |
81 | +deb http://apt.postgresql.org/pub/repos/apt/ $CODENAME-pgdg main | |
82 | +#deb-src http://apt.postgresql.org/pub/repos/apt/ $CODENAME-pgdg main | |
83 | +EOF | |
84 | + | |
85 | +echo "Importing repository signing key ..." | |
86 | +KEYRING="/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg" | |
87 | +test -e $KEYRING || touch $KEYRING | |
88 | +apt-key --keyring $KEYRING add - <<EOF | |
89 | +-----BEGIN PGP PUBLIC KEY BLOCK----- | |
90 | +Version: GnuPG v1 | |
91 | + | |
92 | +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 | |
152 | +IIP9up4xwgje9LB7fMxsSkCDTHOk | |
153 | +=s3DI | |
154 | +-----END PGP PUBLIC KEY BLOCK----- | |
155 | +EOF | |
156 | + | |
157 | +echo "Running apt-get update ..." | |
158 | +apt-get update | |
159 | + | |
160 | +cat <<EOF | |
161 | + | |
162 | +You can now start installing packages from apt.postgresql.org. | |
163 | + | |
164 | +Have a look at https://wiki.postgresql.org/wiki/Apt for more information; | |
165 | +most notably the FAQ at https://wiki.postgresql.org/wiki/Apt/FAQ | |
166 | +EOF | ... | ... |
No preview for this file type
... | ... | @@ -0,0 +1,64 @@ |
1 | +class simec::apache ( | |
2 | +$vhost = $::simec::params::vhost, | |
3 | +$datadir = $::simec::params::datadir, | |
4 | +$apacheuser = $::simec::params::apacheuser | |
5 | +) inherits simec::params { | |
6 | + | |
7 | + class { '::apache': | |
8 | + mpm_module => 'prefork', | |
9 | + } | |
10 | + | |
11 | + include ::apache::mod::php | |
12 | + include ::apache::mod::rewrite | |
13 | + | |
14 | + apache::vhost { $vhost: | |
15 | + servername => $vhost, | |
16 | + port => '80', | |
17 | + docroot => "${datadir}/www", | |
18 | + docroot_owner => "${apacheuser}", | |
19 | + docroot_group => "${apacheuser}", | |
20 | + options => ['Indexes','FollowSymLinks'], | |
21 | + directoryindex => 'login.php index.php', | |
22 | + access_log_file => "${vhost}_access_log", | |
23 | + error_log_file => "${vhost}_error_log", | |
24 | + aliases => [ | |
25 | + { | |
26 | + alias => '/seguranca', | |
27 | + path => "${datadir}/seguranca/www/", | |
28 | + }, | |
29 | + { | |
30 | + alias => '/elabrev', | |
31 | + path => "${datadir}/elabrev/www", | |
32 | + }, | |
33 | + { | |
34 | + alias => '/monitora', | |
35 | + path => "${datadir}/monitora/www", | |
36 | + }, | |
37 | + { | |
38 | + alias => '/financeiro', | |
39 | + path => "${datadir}/financeiro/www", | |
40 | + }, | |
41 | + { | |
42 | + alias => '/zimec', | |
43 | + path => "${datadir}/zimec/public", | |
44 | + }, | |
45 | + { | |
46 | + alias => '/pde', | |
47 | + path => "${datadir}/pde/www", | |
48 | + }, | |
49 | + ], | |
50 | + custom_fragment => " | |
51 | + AddDefaultCharset ISO-8859-1 | |
52 | + php_admin_value output_buffering on | |
53 | + php_admin_value error_reporting 22519 | |
54 | + php_value upload_max_filesize 128M | |
55 | + php_value post_max_size 128M | |
56 | + php_value max_execution_time 60 | |
57 | + php_value max_input_time 60 | |
58 | + php_value memory_limit 256M | |
59 | + php_admin_value include_path \".:${datadir}/global\" | |
60 | + php_admin_value short_open_tag on | |
61 | + php_admin_value date.timezone America/Sao_Paulo | |
62 | + ", | |
63 | + } | |
64 | +} | ... | ... |
... | ... | @@ -0,0 +1,29 @@ |
1 | +class simec::config ( | |
2 | +$datadir = $::simec::params::datadir, | |
3 | +$db_username = $::simec::params::db_username, | |
4 | +$db_password = $::simec::params::db_password, | |
5 | +$db_name = $::simec::params::db_name, | |
6 | +$db_host = $::simec::params::db_host, | |
7 | +$db_port = $::simec::params::db_port, | |
8 | +$apacheuser = $::simec::params::apacheuser, | |
9 | +$emails = $::simec::params::emails, | |
10 | + | |
11 | +) inherits simec::params { | |
12 | + | |
13 | + # Config arquivo principal de configuracao | |
14 | + | |
15 | + file { "${datadir}/global/config.inc": | |
16 | + ensure => present, | |
17 | + owner => $apacheuser, | |
18 | + mode => '0400', | |
19 | + content => template('simec/configinc.erb'), | |
20 | + require => Vcsrepo[$datadir], | |
21 | + } | |
22 | + file { "${datadir}/global/database.php": | |
23 | + ensure => present, | |
24 | + owner => $apacheuser, | |
25 | + mode => '0400', | |
26 | + content => template('simec/database.erb'), | |
27 | + require => Vcsrepo[$datadir], | |
28 | + } | |
29 | +} | ... | ... |
... | ... | @@ -0,0 +1,98 @@ |
1 | +# == Class: simec | |
2 | +# | |
3 | +# Full description of class simec here. | |
4 | +# | |
5 | +# === Parameters | |
6 | +# | |
7 | +# Document parameters here. | |
8 | +# | |
9 | +# [*sample_parameter*] | |
10 | +# Explanation of what this parameter affects and what it defaults to. | |
11 | +# e.g. "Specify one or more upstream ntp servers as an array." | |
12 | +# | |
13 | +# === Variables | |
14 | +# | |
15 | +# Here you should define a list of variables that this module would require. | |
16 | +# | |
17 | +# [*sample_variable*] | |
18 | +# Explanation of how this variable affects the funtion of this class and if | |
19 | +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the | |
20 | +# External Node Classifier as a comma separated list of hostnames." (Note, | |
21 | +# global variables should be avoided in favor of class parameters as | |
22 | +# of Puppet 2.6.) | |
23 | +# | |
24 | +# === Examples | |
25 | +# | |
26 | +#class {'simec': | |
27 | +# vhost => 'meusimec.dominio', | |
28 | +# install_db => false, | |
29 | +# db_name => 'dbsimec', | |
30 | +# db_username => 'usersimec', | |
31 | +# db_password => 'SenhaSuperForte', | |
32 | +# db_host => '192.168.0.1', | |
33 | +# datadir => '/var/www/html/simec', | |
34 | +# source => 'http://urldorepositporiop/simec.git', | |
35 | +# emails => 'meuemail@meudominio', | |
36 | +# vcsprovider => 'git', | |
37 | +#} | |
38 | +# | |
39 | +# === Authors | |
40 | +# | |
41 | +# Thiago Linux <thiagoantonio.sferreira@gmail.com> | |
42 | +# | |
43 | +# === Copyright | |
44 | +# | |
45 | +# Copyright 2016 Your name here, unless otherwise noted. | |
46 | +# | |
47 | +class simec ( | |
48 | +$vhost = $::simec::params::vhost, | |
49 | +$datadir = $::simec::params::datadir, | |
50 | +$apacheuser = $::simec::params::apacheuser, | |
51 | +$db_username = $::simec::params::db_username, | |
52 | +$db_password = $::simec::params::db_password, | |
53 | +$db_name = $::simec::params::db_name, | |
54 | +$db_host = $::simec::params::db_host, | |
55 | +$db_port = $::simec::params::db_port, | |
56 | +$packages = $::simec::params::packages, | |
57 | +$vcsprovider = $::simec::params::vcsprovider, | |
58 | +$repoensure = $::simec::params::repoensure, | |
59 | +$source = $::simec::params::source, | |
60 | +$emails = $::simec::params::emails, | |
61 | +$install_db = false, | |
62 | +) inherits simec::params { | |
63 | + | |
64 | + class { '::simec::install': | |
65 | + repoensure => $reponsure, | |
66 | + datadir => $datadir, | |
67 | + packages => $packages, | |
68 | + vcsprovider => $vcsprovider, | |
69 | + source => $source, | |
70 | + } -> | |
71 | + class { '::simec::apache': | |
72 | + vhost => $vhost, | |
73 | + datadir => $datadir, | |
74 | + apacheuser => $apacheuser, | |
75 | + } -> | |
76 | + class { '::simec::config': | |
77 | + datadir => $datadir, | |
78 | + apacheuser => $apacheuser, | |
79 | + db_username => $db_username, | |
80 | + db_password => $db_password, | |
81 | + db_name => $db_name, | |
82 | + db_host => $db_host, | |
83 | + db_port => $db_port, | |
84 | + emails => $emails, | |
85 | + | |
86 | + } | |
87 | + | |
88 | + if $install_db == true { | |
89 | + class { '::simec::postgresql': | |
90 | + db_username => $db_username, | |
91 | + db_password => $db_password, | |
92 | + db_name => $db_name, | |
93 | + db_host => $db_host, | |
94 | + db_port => $db_port, | |
95 | + } | |
96 | + } | |
97 | + | |
98 | +} | ... | ... |
... | ... | @@ -0,0 +1,24 @@ |
1 | +class simec::install ( | |
2 | +$datadir = $::simec::params::datadir, | |
3 | +$packages = $::simec::params::packages, | |
4 | +$vcsprovider = $::simec::params::vcsprovider, | |
5 | +$repoensure = $::simec::params::repoensure, | |
6 | +$source = $::simec::params::source, | |
7 | + | |
8 | +) inherits simec::params { | |
9 | + | |
10 | + package { $packages : | |
11 | + ensure => present, | |
12 | + } | |
13 | + | |
14 | + package { $vcsprovider : | |
15 | + ensure => present, | |
16 | + } | |
17 | + | |
18 | + vcsrepo { $datadir: | |
19 | + ensure => $repoensure, | |
20 | + provider => $vcsprovider, | |
21 | + source => $source, | |
22 | + require => Package[$vcsprovider], | |
23 | + } | |
24 | +} | ... | ... |
... | ... | @@ -0,0 +1,46 @@ |
1 | +class simec::params { | |
2 | + $vhost = 'simec.dominio.gov.br' | |
3 | + $db_username = 'user_simec' | |
4 | + $db_password = '841j8K9J67p788x' | |
5 | + $db_name = 'db_simec' | |
6 | + $db_host = "$::ipaddress" | |
7 | + $db_port = '5432' | |
8 | + $datadir = '/var/www/html/simec/' | |
9 | + $repoensure = 'present' | |
10 | + $vcsprovider = 'git' | |
11 | + $source = 'https://softwarepublico.gov.br/gitlab/simec/simec.git' | |
12 | + $emails = 'seuemail@dominio' | |
13 | + | |
14 | + case $::osfamily { | |
15 | + | |
16 | + 'RedHat': { | |
17 | + $apacheuser = 'apache' | |
18 | + $packages = [ | |
19 | + 'php-pgsql', | |
20 | + 'php-gd', | |
21 | + 'php-mbstring', | |
22 | + 'php-bcmath', | |
23 | + 'php-soap', | |
24 | + 'gzip', | |
25 | + ] | |
26 | + | |
27 | + } | |
28 | + | |
29 | + 'Debian': { | |
30 | + $apacheuser = 'www-data' | |
31 | + $packages = [ | |
32 | + 'php5-pgsql', | |
33 | + 'php5-gd', | |
34 | + 'php5-curl', | |
35 | + 'php-soap', | |
36 | + 'gzip', | |
37 | + 'sudo', | |
38 | + ] | |
39 | + } | |
40 | + | |
41 | + default: { | |
42 | + fail("${module_name} module is not supported on osfamily ${::osfamily}.") | |
43 | + } | |
44 | + | |
45 | + } | |
46 | +} | ... | ... |
... | ... | @@ -0,0 +1,180 @@ |
1 | +class simec::postgresql ( | |
2 | +$db_username = $::simec::params::db_username, | |
3 | +$db_password = $::simec::params::db_password, | |
4 | +$db_name = $::simec::params::db_name, | |
5 | +$db_host = $::simec::params::db_host, | |
6 | +$db_port = $::simec::params::db_port, | |
7 | +) inherits simec::params { | |
8 | + | |
9 | + | |
10 | + case $::osfamily { | |
11 | + | |
12 | + 'RedHat': { | |
13 | + | |
14 | + # Instar o repositório | |
15 | + exec { 'exclude_pkg_centos': | |
16 | + command => "sed -i 's/[base]/[base]\nexclude=postgresql*/g' /etc/yum.repos.d/CentOS-Base.repo", | |
17 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
18 | + unless => "cat /etc/yum.repos.d/CentOS-Base.repo | grep \"exclude=postgresql\"", | |
19 | + notify => Exec['postgres_repo'], | |
20 | + } | |
21 | + | |
22 | + exec { 'postgres_repo': | |
23 | + 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", | |
24 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
25 | + require => Exec['exclude_pkg_centos'], | |
26 | + refreshonly => true, | |
27 | + } | |
28 | + | |
29 | + package { [ 'epel-release', 'postgresql93-server', 'postgresql93', 'postgresql93-libs', 'postgresql93-contrib' ] : | |
30 | + ensure => installed, | |
31 | + notify => Exec['run_initdb'], | |
32 | + require => Exec['postgres_repo'] | |
33 | + }-> | |
34 | + package { [ 'gdal', 'gdal-devel', 'gdal-java', 'gdal-perl', 'gdal-python' ] : | |
35 | + ensure => installed, | |
36 | + require => Exec['run_initdb'] | |
37 | + }-> | |
38 | + package { [ 'postgis2_93', 'postgis2_93-devel', 'postgis2_93-docs', 'postgis2_93-utils' ] : | |
39 | + ensure => installed | |
40 | + }-> | |
41 | + pg_hba { "host to $db_username on $db_name from $::ipaddress/32": | |
42 | + ensure => present, | |
43 | + method => 'md5', | |
44 | + target => '/var/lib/pgsql/9.3/data/pg_hba.conf', | |
45 | + }-> | |
46 | + file { '/var/lib/pgsql/9.3/data/postgresql.conf': | |
47 | + force => true, | |
48 | + ensure => 'file', | |
49 | + group => 'postgres', | |
50 | + mode => '600', | |
51 | + owner => 'postgres', | |
52 | + content => template('simec/postgresql.conf.centos.erb'), | |
53 | + notify => [ | |
54 | + Service['postgresql'], | |
55 | + Exec['setup_db'] | |
56 | + ] | |
57 | + } | |
58 | + | |
59 | + exec { 'run_initdb': | |
60 | + command => "/usr/pgsql-9.3/bin/postgresql93-setup initdb", | |
61 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/pgsql-9.3/bin', | |
62 | + refreshonly => true, | |
63 | + } | |
64 | + | |
65 | + service { 'postgresql': | |
66 | + name => 'postgresql-9.3', | |
67 | + ensure => running, | |
68 | + enable => true, | |
69 | + require => File['/var/lib/pgsql/9.3/data/postgresql.conf'], | |
70 | + } | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | + augeas { "turn off sudo requiretty": | |
76 | + changes => [ | |
77 | + 'set /files/etc/sudoers/Defaults[*]/requiretty/negate ""', | |
78 | + ], | |
79 | + } | |
80 | + | |
81 | + exec { 'restore_db': | |
82 | + environment => "PGPASSWORD=$db_password", | |
83 | + 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", | |
84 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
85 | + require => [ | |
86 | + Service['postgresql'], | |
87 | + File['/opt/dump_simec.tar.gz'], | |
88 | + Augeas['turn off sudo requiretty'], | |
89 | + ], | |
90 | + returns => [0, 1], | |
91 | + refreshonly => true, | |
92 | + } | |
93 | + | |
94 | + } | |
95 | + | |
96 | + 'Debian': { | |
97 | + | |
98 | + # instalar repositorio | |
99 | + file { '/opt/apt.postgresql.org.sh': | |
100 | + ensure => file, | |
101 | + mode => '0754', | |
102 | + owner => 'root', | |
103 | + group => 'root', | |
104 | + source => 'puppet:///modules/simec/apt.postgresql.org.sh', | |
105 | + notify => Exec['postgres_repo_apt'] | |
106 | + } | |
107 | + exec { 'postgres_repo_apt': | |
108 | + command => "sh /opt/apt.postgresql.org.sh", | |
109 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
110 | + require => File['/opt/apt.postgresql.org.sh'], | |
111 | + refreshonly => true, | |
112 | + } | |
113 | + | |
114 | + package { [ 'postgresql-9.3-postgis-2.1', 'postgresql-9.3-postgis-2.1-scripts', 'postgresql-client-9.3', 'postgresql-contrib-9.3' ] : | |
115 | + ensure => installed, | |
116 | + require => Exec['postgres_repo_apt'] | |
117 | + }-> | |
118 | + pg_hba { "host to $db_username on $db_name from $::ipaddress/32": | |
119 | + ensure => present, | |
120 | + method => 'md5', | |
121 | + target => '/etc/postgresql/9.3/main/pg_hba.conf', | |
122 | + }-> | |
123 | + file { '/etc/postgresql/9.3/main/postgresql.conf': | |
124 | + force => true, | |
125 | + ensure => 'file', | |
126 | + group => 'postgres', | |
127 | + mode => '600', | |
128 | + owner => 'postgres', | |
129 | + content => template('simec/postgresql.conf.debian.erb'), | |
130 | + notify => [ | |
131 | + Service['postgresql'], | |
132 | + Exec['setup_db'] | |
133 | + ] | |
134 | + } | |
135 | + | |
136 | + service { 'postgresql': | |
137 | + name => 'postgresql', | |
138 | + ensure => running, | |
139 | + enable => true, | |
140 | + require => [ | |
141 | + File['/etc/postgresql/9.3/main/postgresql.conf'], | |
142 | + ], | |
143 | + } | |
144 | + | |
145 | + exec { 'restore_db': | |
146 | + environment => "PGPASSWORD=$db_password", | |
147 | + 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", | |
148 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
149 | + require => [ | |
150 | + Service['postgresql'], | |
151 | + File['/opt/dump_simec.tar.gz'] | |
152 | + ], | |
153 | + returns => [0, 1], | |
154 | + refreshonly => true, | |
155 | + } | |
156 | + } | |
157 | + | |
158 | + | |
159 | + default: { | |
160 | + fail("${module_name} module is not supported on osfamily ${::osfamily}.") | |
161 | + } | |
162 | + | |
163 | + } | |
164 | + | |
165 | + file { '/opt/dump_simec.tar.gz': | |
166 | + ensure => file, | |
167 | + mode => '0644', | |
168 | + owner => 'root', | |
169 | + group => 'root', | |
170 | + source => 'puppet:///modules/simec/dump_simec.tar.gz', | |
171 | + } | |
172 | + | |
173 | + exec { 'setup_db': | |
174 | + 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\'\"", | |
175 | + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
176 | + require => Service['postgresql'], | |
177 | + notify => Exec['restore_db'], | |
178 | + refreshonly => true | |
179 | + } | |
180 | +} | ... | ... |
... | ... | @@ -0,0 +1,55 @@ |
1 | +{ | |
2 | + "name":"minc-simec", | |
3 | + "version":"0.1.0", | |
4 | + "author":"thiagolinux", | |
5 | + "summary":"Puppet module for install SIMEC", | |
6 | + "license":"Apache 2.0", | |
7 | + "source":"", | |
8 | + "project_page":"https://softwarepublico.gov.br/social/simec/", | |
9 | + "issues_url":null, | |
10 | + "operatingsystem_support":[ | |
11 | + { | |
12 | + "operatingsystem":"RedHat", | |
13 | + "operatingsystemrelease":[ | |
14 | + "7", | |
15 | + ] | |
16 | + }, | |
17 | + { | |
18 | + "operatingsystem":"CentOS", | |
19 | + "operatingsystemrelease":[ | |
20 | + "7", | |
21 | + ] | |
22 | + }, | |
23 | + { | |
24 | + "operatingsystem":"Debian", | |
25 | + "operatingsystemrelease":[ | |
26 | + "7", | |
27 | + "8" | |
28 | + ] | |
29 | + } | |
30 | + ], | |
31 | + "dependencies":[ | |
32 | + { | |
33 | + "name":"puppetlabs/apache", | |
34 | + "version_requirement":">= 1.10.0" | |
35 | + }, | |
36 | + { | |
37 | + "name":"puppetlabs/vcsrepo", | |
38 | + "version_requirement":">= 1.3.2" | |
39 | + }, | |
40 | + { | |
41 | + "name":"herculesteam/augeasproviders_postgresql", | |
42 | + "version_requirement":">= 2.0.3" | |
43 | + } | |
44 | + ], | |
45 | + "requirements":[ | |
46 | + { | |
47 | + "name":"pe", | |
48 | + "version_requirement":"3.x" | |
49 | + }, | |
50 | + { | |
51 | + "name":"puppet", | |
52 | + "version_requirement":"3.x" | |
53 | + } | |
54 | + ] | |
55 | +} | ... | ... |
... | ... | @@ -0,0 +1,17 @@ |
1 | +dir = File.expand_path(File.dirname(__FILE__)) | |
2 | +$LOAD_PATH.unshift File.join(dir, 'lib') | |
3 | + | |
4 | +require 'mocha' | |
5 | +require 'puppet' | |
6 | +require 'rspec' | |
7 | +require 'spec/autorun' | |
8 | + | |
9 | +Spec::Runner.configure do |config| | |
10 | + config.mock_with :mocha | |
11 | +end | |
12 | + | |
13 | +# We need this because the RAL uses 'should' as a method. This | |
14 | +# allows us the same behaviour but with a different method name. | |
15 | +class Object | |
16 | + alias :must :should | |
17 | +end | ... | ... |
... | ... | @@ -0,0 +1,53 @@ |
1 | +<?php | |
2 | + global $servidor_bd, $porta_bd, $nome_bd, $usuario_db, $senha_bd, $email_sistema,$servidor_bd_siafi, $porta_bd_siafi, $nome_bd_siafi, $usuario_db_siafi, $senha_bd_siafi; | |
3 | + | |
4 | + /** | |
5 | + * Configuração PHP | |
6 | + */ | |
7 | + session_start(); | |
8 | + ini_set("short_open_tag","on"); | |
9 | + ini_set('display_errors', 'on'); | |
10 | + error_reporting(E_ALL ^E_NOTICE); | |
11 | + date_default_timezone_set('America/Sao_Paulo'); | |
12 | + header('content-type: text/html; charset=ISO-8859-1'); | |
13 | + | |
14 | + defined('AUTHSSD') || define('AUTHSSD', false); | |
15 | + defined('APPRAIZ') || define('APPRAIZ', '<%= @datadir %>/'); | |
16 | + defined('DIRFILES') || define('DIRFILES', APPRAIZ. 'arquivos/'); | |
17 | + defined('SISRAIZ') || define('SISRAIZ', APPRAIZ . $_SESSION['sisdiretorio'] . '/'); | |
18 | + defined('MAXONLINETIME') || define('MAXONLINETIME', 3600); | |
19 | + defined('IS_PRODUCAO') || define('IS_PRODUCAO', false); | |
20 | + | |
21 | + $_SESSION['ambiente'] = IS_PRODUCAO ? 'Ambiente de Produção' : 'Ambiente de Desenvolvimento'; | |
22 | + $_SESSION['sisbaselogin'] = $_REQUEST['baselogin'] && $_REQUEST['baselogin'] != "teste" ? $_REQUEST['baselogin'] : $_SESSION['sisbaselogin']; | |
23 | + $_SESSION['baselogin'] = $_REQUEST['baselogin'] ? $_REQUEST['baselogin'] : $_SESSION['baselogin']; | |
24 | + | |
25 | + # Configuração de Banco de Dados | |
26 | + include_once 'database.php'; | |
27 | + | |
28 | + $email_sistema = '<%= @emails %>'; | |
29 | + | |
30 | + preg_match('/\/([a-zA-Z]*)\//', $_SERVER['REQUEST_URI'], $sisdiretorio); | |
31 | + $sisdiretorio = $sisdiretorio[1]; | |
32 | + | |
33 | + preg_match('/\/([a-zA-Z]*)\.php/', $_SERVER['REQUEST_URI'], $sisarquivo); | |
34 | + $sisarquivo = $sisarquivo[1]; | |
35 | + | |
36 | + include_once APPRAIZ. 'includes/simec_funcoes.inc'; | |
37 | + include_once APPRAIZ. 'includes/backtrace/BackTrace.php'; | |
38 | + include_once APPRAIZ. 'includes/backtrace/BackTraceExplain.php'; | |
39 | + include_once APPRAIZ. 'includes/failure/ErrorHandler.php'; | |
40 | + include_once APPRAIZ. 'includes/failure/ExceptionHandler.php'; | |
41 | + include_once APPRAIZ. 'includes/library/simec/SoapClient.php'; | |
42 | + include_once APPRAIZ. "includes/connection/adapter-connection.php"; | |
43 | + | |
44 | + function fechar_conexoes(){ | |
45 | + while( pg_ping()){ | |
46 | + pg_close(); | |
47 | + } | |
48 | + } | |
49 | + register_shutdown_function('fechar_conexoes'); | |
50 | + ErrorHandler::start(); | |
51 | + ExceptionHandler::start(); | |
52 | + ob_start(); | |
53 | + | ... | ... |
... | ... | @@ -0,0 +1,31 @@ |
1 | +<?php | |
2 | + | |
3 | +# Sistema SIEMC - PRODUO | |
4 | +$nome_bd = '<%= @db_name %>'; | |
5 | +$servidor_bd = '<%= @db_host %>'; | |
6 | +$porta_bd = '<%= @db_port %>'; | |
7 | +$usuario_db = '<%= @db_username %>'; | |
8 | +$senha_bd = '<%= @db_password %>'; | |
9 | + | |
10 | +# Sistema SIAFI - PRODUO | |
11 | +$servidor_bd_siafi = ''; | |
12 | +$porta_bd_siafi = ''; | |
13 | +$nome_bd_siafi = ''; | |
14 | +$usuario_db_siafi = ''; | |
15 | +$senha_bd_siafi = ''; | |
16 | + | |
17 | +# Sistema PDDEInterativo - PRODUO | |
18 | +$configDbPddeinterativo = new stdClass(); | |
19 | +$configDbPddeinterativo->host = ''; | |
20 | +$configDbPddeinterativo->port = ''; | |
21 | +$configDbPddeinterativo->dbname = ''; | |
22 | +$configDbPddeinterativo->user = ''; | |
23 | +$configDbPddeinterativo->password = ''; | |
24 | + | |
25 | +# Sistema SIGFOR | |
26 | +$configDbSigfor = new stdClass(); | |
27 | +$configDbSigfor->host = ''; | |
28 | +$configDbSigfor->port = ''; | |
29 | +$configDbSigfor->dbname = ''; | |
30 | +$configDbSigfor->user = ''; | |
31 | +$configDbSigfor->password = ''; | ... | ... |
... | ... | @@ -0,0 +1,603 @@ |
1 | +################################################# | |
2 | +######## Arquivo Gerenciado pelo Puppet ######### | |
3 | +######## !!!!!! NAO EDITE DIRETAMENTE !!!!!!!! ## | |
4 | +######## Edite na paste de templates ############ | |
5 | +################################################# | |
6 | +# ----------------------------- | |
7 | +# PostgreSQL configuration file | |
8 | +# ----------------------------- | |
9 | +# | |
10 | +# This file consists of lines of the form: | |
11 | +# | |
12 | +# name = value | |
13 | +# | |
14 | +# (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
15 | +# "#" anywhere on a line. The complete list of parameter names and allowed | |
16 | +# values can be found in the PostgreSQL documentation. | |
17 | +# | |
18 | +# The commented-out settings shown in this file represent the default values. | |
19 | +# Re-commenting a setting is NOT sufficient to revert it to the default value; | |
20 | +# you need to reload the server. | |
21 | +# | |
22 | +# This file is read on server startup and when the server receives a SIGHUP | |
23 | +# signal. If you edit the file on a running system, you have to SIGHUP the | |
24 | +# server for the changes to take effect, or use "pg_ctl reload". Some | |
25 | +# parameters, which are marked below, require a server shutdown and restart to | |
26 | +# take effect. | |
27 | +# | |
28 | +# Any parameter can also be given as a command-line option to the server, e.g., | |
29 | +# "postgres -c log_connections=on". Some parameters can be changed at run time | |
30 | +# with the "SET" SQL command. | |
31 | +# | |
32 | +# Memory units: kB = kilobytes Time units: ms = milliseconds | |
33 | +# MB = megabytes s = seconds | |
34 | +# GB = gigabytes min = minutes | |
35 | +# h = hours | |
36 | +# d = days | |
37 | + | |
38 | + | |
39 | +#------------------------------------------------------------------------------ | |
40 | +# FILE LOCATIONS | |
41 | +#------------------------------------------------------------------------------ | |
42 | + | |
43 | +# The default values of these variables are driven from the -D command-line | |
44 | +# option or PGDATA environment variable, represented here as ConfigDir. | |
45 | + | |
46 | +#data_directory = 'ConfigDir' # use data in another directory | |
47 | + # (change requires restart) | |
48 | +#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file | |
49 | + # (change requires restart) | |
50 | +#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file | |
51 | + # (change requires restart) | |
52 | + | |
53 | +# If external_pid_file is not explicitly set, no extra PID file is written. | |
54 | +#external_pid_file = '' # write an extra PID file | |
55 | + # (change requires restart) | |
56 | + | |
57 | + | |
58 | +#------------------------------------------------------------------------------ | |
59 | +# CONNECTIONS AND AUTHENTICATION | |
60 | +#------------------------------------------------------------------------------ | |
61 | + | |
62 | +# - Connection Settings - | |
63 | + | |
64 | +listen_addresses = '*' # what IP address(es) to listen on; | |
65 | + # comma-separated list of addresses; | |
66 | + # defaults to 'localhost'; use '*' for all | |
67 | + # (change requires restart) | |
68 | +port = <%= @db_port %> # (change requires restart) | |
69 | + | |
70 | +max_connections = 100 # (change requires restart) | |
71 | +# Note: Increasing max_connections costs ~400 bytes of shared memory per | |
72 | +# connection slot, plus lock space (see max_locks_per_transaction). | |
73 | +#superuser_reserved_connections = 3 # (change requires restart) | |
74 | +#unix_socket_directories = '/tmp' # comma-separated list of directories | |
75 | + # (change requires restart) | |
76 | +#unix_socket_group = '' # (change requires restart) | |
77 | +#unix_socket_permissions = 0777 # begin with 0 to use octal notation | |
78 | + # (change requires restart) | |
79 | +#bonjour = off # advertise server via Bonjour | |
80 | + # (change requires restart) | |
81 | +#bonjour_name = '' # defaults to the computer name | |
82 | + # (change requires restart) | |
83 | + | |
84 | +# - Security and Authentication - | |
85 | + | |
86 | +#authentication_timeout = 1min # 1s-600s | |
87 | +#ssl = off # (change requires restart) | |
88 | +#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers | |
89 | + # (change requires restart) | |
90 | +#ssl_renegotiation_limit = 0 # amount of data between renegotiations | |
91 | +#ssl_cert_file = 'server.crt' # (change requires restart) | |
92 | +#ssl_key_file = 'server.key' # (change requires restart) | |
93 | +#ssl_ca_file = '' # (change requires restart) | |
94 | +#ssl_crl_file = '' # (change requires restart) | |
95 | +#password_encryption = on | |
96 | +#db_user_namespace = off | |
97 | + | |
98 | +# Kerberos and GSSAPI | |
99 | +#krb_server_keyfile = '' | |
100 | +#krb_srvname = 'postgres' # (Kerberos only) | |
101 | +#krb_caseins_users = off | |
102 | + | |
103 | +# - TCP Keepalives - | |
104 | +# see "man 7 tcp" for details | |
105 | + | |
106 | +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; | |
107 | + # 0 selects the system default | |
108 | +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; | |
109 | + # 0 selects the system default | |
110 | +#tcp_keepalives_count = 0 # TCP_KEEPCNT; | |
111 | + # 0 selects the system default | |
112 | + | |
113 | + | |
114 | +#------------------------------------------------------------------------------ | |
115 | +# RESOURCE USAGE (except WAL) | |
116 | +#------------------------------------------------------------------------------ | |
117 | + | |
118 | +# - Memory - | |
119 | + | |
120 | +shared_buffers = 128MB # min 128kB | |
121 | + # (change requires restart) | |
122 | +#temp_buffers = 8MB # min 800kB | |
123 | +#max_prepared_transactions = 0 # zero disables the feature | |
124 | + # (change requires restart) | |
125 | +# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory | |
126 | +# per transaction slot, plus lock space (see max_locks_per_transaction). | |
127 | +# It is not advisable to set max_prepared_transactions nonzero unless you | |
128 | +# actively intend to use prepared transactions. | |
129 | +#work_mem = 1MB # min 64kB | |
130 | +#maintenance_work_mem = 16MB # min 1MB | |
131 | +#max_stack_depth = 2MB # min 100kB | |
132 | + | |
133 | +# - Disk - | |
134 | + | |
135 | +#temp_file_limit = -1 # limits per-session temp file space | |
136 | + # in kB, or -1 for no limit | |
137 | + | |
138 | +# - Kernel Resource Usage - | |
139 | + | |
140 | +#max_files_per_process = 1000 # min 25 | |
141 | + # (change requires restart) | |
142 | +#shared_preload_libraries = '' # (change requires restart) | |
143 | + | |
144 | +# - Cost-Based Vacuum Delay - | |
145 | + | |
146 | +#vacuum_cost_delay = 0 # 0-100 milliseconds | |
147 | +#vacuum_cost_page_hit = 1 # 0-10000 credits | |
148 | +#vacuum_cost_page_miss = 10 # 0-10000 credits | |
149 | +#vacuum_cost_page_dirty = 20 # 0-10000 credits | |
150 | +#vacuum_cost_limit = 200 # 1-10000 credits | |
151 | + | |
152 | +# - Background Writer - | |
153 | + | |
154 | +#bgwriter_delay = 200ms # 10-10000ms between rounds | |
155 | +#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round | |
156 | +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round | |
157 | + | |
158 | +# - Asynchronous Behavior - | |
159 | + | |
160 | +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching | |
161 | + | |
162 | + | |
163 | +#------------------------------------------------------------------------------ | |
164 | +# WRITE AHEAD LOG | |
165 | +#------------------------------------------------------------------------------ | |
166 | + | |
167 | +# - Settings - | |
168 | + | |
169 | +#wal_level = minimal # minimal, archive, or hot_standby | |
170 | + # (change requires restart) | |
171 | +#fsync = on # turns forced synchronization on or off | |
172 | +#synchronous_commit = on # synchronization level; | |
173 | + # off, local, remote_write, or on | |
174 | +#wal_sync_method = fsync # the default is the first option | |
175 | + # supported by the operating system: | |
176 | + # open_datasync | |
177 | + # fdatasync (default on Linux) | |
178 | + # fsync | |
179 | + # fsync_writethrough | |
180 | + # open_sync | |
181 | +#full_page_writes = on # recover from partial page writes | |
182 | +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers | |
183 | + # (change requires restart) | |
184 | +#wal_writer_delay = 200ms # 1-10000 milliseconds | |
185 | + | |
186 | +#commit_delay = 0 # range 0-100000, in microseconds | |
187 | +#commit_siblings = 5 # range 1-1000 | |
188 | + | |
189 | +# - Checkpoints - | |
190 | + | |
191 | +#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each | |
192 | +#checkpoint_timeout = 5min # range 30s-1h | |
193 | +#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 | |
194 | +#checkpoint_warning = 30s # 0 disables | |
195 | + | |
196 | +# - Archiving - | |
197 | + | |
198 | +#archive_mode = off # allows archiving to be done | |
199 | + # (change requires restart) | |
200 | +#archive_command = '' # command to use to archive a logfile segment | |
201 | + # placeholders: %p = path of file to archive | |
202 | + # %f = file name only | |
203 | + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' | |
204 | +#archive_timeout = 0 # force a logfile segment switch after this | |
205 | + # number of seconds; 0 disables | |
206 | + | |
207 | + | |
208 | +#------------------------------------------------------------------------------ | |
209 | +# REPLICATION | |
210 | +#------------------------------------------------------------------------------ | |
211 | + | |
212 | +# - Sending Server(s) - | |
213 | + | |
214 | +# Set these on the master and on any standby that will send replication data. | |
215 | + | |
216 | +#max_wal_senders = 0 # max number of walsender processes | |
217 | + # (change requires restart) | |
218 | +#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables | |
219 | +#wal_sender_timeout = 60s # in milliseconds; 0 disables | |
220 | + | |
221 | +# - Master Server - | |
222 | + | |
223 | +# These settings are ignored on a standby server. | |
224 | + | |
225 | +#synchronous_standby_names = '' # standby servers that provide sync rep | |
226 | + # comma-separated list of application_name | |
227 | + # from standby(s); '*' = all | |
228 | +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed | |
229 | + | |
230 | +# - Standby Servers - | |
231 | + | |
232 | +# These settings are ignored on a master server. | |
233 | + | |
234 | +#hot_standby = off # "on" allows queries during recovery | |
235 | + # (change requires restart) | |
236 | +#max_standby_archive_delay = 30s # max delay before canceling queries | |
237 | + # when reading WAL from archive; | |
238 | + # -1 allows indefinite delay | |
239 | +#max_standby_streaming_delay = 30s # max delay before canceling queries | |
240 | + # when reading streaming WAL; | |
241 | + # -1 allows indefinite delay | |
242 | +#wal_receiver_status_interval = 10s # send replies at least this often | |
243 | + # 0 disables | |
244 | +#hot_standby_feedback = off # send info from standby to prevent | |
245 | + # query conflicts | |
246 | +#wal_receiver_timeout = 60s # time that receiver waits for | |
247 | + # communication from master | |
248 | + # in milliseconds; 0 disables | |
249 | + | |
250 | + | |
251 | +#------------------------------------------------------------------------------ | |
252 | +# QUERY TUNING | |
253 | +#------------------------------------------------------------------------------ | |
254 | + | |
255 | +# - Planner Method Configuration - | |
256 | + | |
257 | +#enable_bitmapscan = on | |
258 | +#enable_hashagg = on | |
259 | +#enable_hashjoin = on | |
260 | +#enable_indexscan = on | |
261 | +#enable_indexonlyscan = on | |
262 | +#enable_material = on | |
263 | +#enable_mergejoin = on | |
264 | +#enable_nestloop = on | |
265 | +#enable_seqscan = on | |
266 | +#enable_sort = on | |
267 | +#enable_tidscan = on | |
268 | + | |
269 | +# - Planner Cost Constants - | |
270 | + | |
271 | +#seq_page_cost = 1.0 # measured on an arbitrary scale | |
272 | +#random_page_cost = 4.0 # same scale as above | |
273 | +#cpu_tuple_cost = 0.01 # same scale as above | |
274 | +#cpu_index_tuple_cost = 0.005 # same scale as above | |
275 | +#cpu_operator_cost = 0.0025 # same scale as above | |
276 | +#effective_cache_size = 128MB | |
277 | + | |
278 | +# - Genetic Query Optimizer - | |
279 | + | |
280 | +#geqo = on | |
281 | +#geqo_threshold = 12 | |
282 | +#geqo_effort = 5 # range 1-10 | |
283 | +#geqo_pool_size = 0 # selects default based on effort | |
284 | +#geqo_generations = 0 # selects default based on effort | |
285 | +#geqo_selection_bias = 2.0 # range 1.5-2.0 | |
286 | +#geqo_seed = 0.0 # range 0.0-1.0 | |
287 | + | |
288 | +# - Other Planner Options - | |
289 | + | |
290 | +#default_statistics_target = 100 # range 1-10000 | |
291 | +#constraint_exclusion = partition # on, off, or partition | |
292 | +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 | |
293 | +#from_collapse_limit = 8 | |
294 | +#join_collapse_limit = 8 # 1 disables collapsing of explicit | |
295 | + # JOIN clauses | |
296 | + | |
297 | + | |
298 | +#------------------------------------------------------------------------------ | |
299 | +# ERROR REPORTING AND LOGGING | |
300 | +#------------------------------------------------------------------------------ | |
301 | + | |
302 | +# - Where to Log - | |
303 | + | |
304 | +log_destination = 'stderr' # Valid values are combinations of | |
305 | + # stderr, csvlog, syslog, and eventlog, | |
306 | + # depending on platform. csvlog | |
307 | + # requires logging_collector to be on. | |
308 | + | |
309 | +# This is used when logging to stderr: | |
310 | +logging_collector = on # Enable capturing of stderr and csvlog | |
311 | + # into log files. Required to be on for | |
312 | + # csvlogs. | |
313 | + # (change requires restart) | |
314 | + | |
315 | +# These are only used if logging_collector is on: | |
316 | +log_directory = 'pg_log' # directory where log files are written, | |
317 | + # can be absolute or relative to PGDATA | |
318 | +log_filename = 'postgresql-%a.log' # log file name pattern, | |
319 | + # can include strftime() escapes | |
320 | +#log_file_mode = 0600 # creation mode for log files, | |
321 | + # begin with 0 to use octal notation | |
322 | +log_truncate_on_rotation = on # If on, an existing log file with the | |
323 | + # same name as the new log file will be | |
324 | + # truncated rather than appended to. | |
325 | + # But such truncation only occurs on | |
326 | + # time-driven rotation, not on restarts | |
327 | + # or size-driven rotation. Default is | |
328 | + # off, meaning append to existing files | |
329 | + # in all cases. | |
330 | +log_rotation_age = 1d # Automatic rotation of logfiles will | |
331 | + # happen after that time. 0 disables. | |
332 | +log_rotation_size = 0 # Automatic rotation of logfiles will | |
333 | + # happen after that much log output. | |
334 | + # 0 disables. | |
335 | + | |
336 | +# These are relevant when logging to syslog: | |
337 | +#syslog_facility = 'LOCAL0' | |
338 | +#syslog_ident = 'postgres' | |
339 | + | |
340 | +# This is only relevant when logging to eventlog (win32): | |
341 | +#event_source = 'PostgreSQL' | |
342 | + | |
343 | +# - When to Log - | |
344 | + | |
345 | +#client_min_messages = notice # values in order of decreasing detail: | |
346 | + # debug5 | |
347 | + # debug4 | |
348 | + # debug3 | |
349 | + # debug2 | |
350 | + # debug1 | |
351 | + # log | |
352 | + # notice | |
353 | + # warning | |
354 | + # error | |
355 | + | |
356 | +#log_min_messages = warning # values in order of decreasing detail: | |
357 | + # debug5 | |
358 | + # debug4 | |
359 | + # debug3 | |
360 | + # debug2 | |
361 | + # debug1 | |
362 | + # info | |
363 | + # notice | |
364 | + # warning | |
365 | + # error | |
366 | + # log | |
367 | + # fatal | |
368 | + # panic | |
369 | + | |
370 | +#log_min_error_statement = error # values in order of decreasing detail: | |
371 | + # debug5 | |
372 | + # debug4 | |
373 | + # debug3 | |
374 | + # debug2 | |
375 | + # debug1 | |
376 | + # info | |
377 | + # notice | |
378 | + # warning | |
379 | + # error | |
380 | + # log | |
381 | + # fatal | |
382 | + # panic (effectively off) | |
383 | + | |
384 | +#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements | |
385 | + # and their durations, > 0 logs only | |
386 | + # statements running at least this number | |
387 | + # of milliseconds | |
388 | + | |
389 | + | |
390 | +# - What to Log - | |
391 | + | |
392 | +#debug_print_parse = off | |
393 | +#debug_print_rewritten = off | |
394 | +#debug_print_plan = off | |
395 | +#debug_pretty_print = on | |
396 | +#log_checkpoints = off | |
397 | +#log_connections = off | |
398 | +#log_disconnections = off | |
399 | +#log_duration = off | |
400 | +#log_error_verbosity = default # terse, default, or verbose messages | |
401 | +#log_hostname = off | |
402 | +log_line_prefix = '< %m >' # special values: | |
403 | + # %a = application name | |
404 | + # %u = user name | |
405 | + # %d = database name | |
406 | + # %r = remote host and port | |
407 | + # %h = remote host | |
408 | + # %p = process ID | |
409 | + # %t = timestamp without milliseconds | |
410 | + # %m = timestamp with milliseconds | |
411 | + # %i = command tag | |
412 | + # %e = SQL state | |
413 | + # %c = session ID | |
414 | + # %l = session line number | |
415 | + # %s = session start timestamp | |
416 | + # %v = virtual transaction ID | |
417 | + # %x = transaction ID (0 if none) | |
418 | + # %q = stop here in non-session | |
419 | + # processes | |
420 | + # %% = '%' | |
421 | + # e.g. '<%u%%%d> ' | |
422 | +#log_lock_waits = off # log lock waits >= deadlock_timeout | |
423 | +#log_statement = 'none' # none, ddl, mod, all | |
424 | +#log_temp_files = -1 # log temporary files equal or larger | |
425 | + # than the specified size in kilobytes; | |
426 | + # -1 disables, 0 logs all temp files | |
427 | +log_timezone = 'Brazil/East' | |
428 | + | |
429 | + | |
430 | +#------------------------------------------------------------------------------ | |
431 | +# RUNTIME STATISTICS | |
432 | +#------------------------------------------------------------------------------ | |
433 | + | |
434 | +# - Query/Index Statistics Collector - | |
435 | + | |
436 | +#track_activities = on | |
437 | +#track_counts = on | |
438 | +#track_io_timing = off | |
439 | +#track_functions = none # none, pl, all | |
440 | +#track_activity_query_size = 1024 # (change requires restart) | |
441 | +#update_process_title = on | |
442 | +#stats_temp_directory = 'pg_stat_tmp' | |
443 | + | |
444 | + | |
445 | +# - Statistics Monitoring - | |
446 | + | |
447 | +#log_parser_stats = off | |
448 | +#log_planner_stats = off | |
449 | +#log_executor_stats = off | |
450 | +#log_statement_stats = off | |
451 | + | |
452 | + | |
453 | +#------------------------------------------------------------------------------ | |
454 | +# AUTOVACUUM PARAMETERS | |
455 | +#------------------------------------------------------------------------------ | |
456 | + | |
457 | +#autovacuum = on # Enable autovacuum subprocess? 'on' | |
458 | + # requires track_counts to also be on. | |
459 | +#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and | |
460 | + # their durations, > 0 logs only | |
461 | + # actions running at least this number | |
462 | + # of milliseconds. | |
463 | +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses | |
464 | + # (change requires restart) | |
465 | +#autovacuum_naptime = 1min # time between autovacuum runs | |
466 | +#autovacuum_vacuum_threshold = 50 # min number of row updates before | |
467 | + # vacuum | |
468 | +#autovacuum_analyze_threshold = 50 # min number of row updates before | |
469 | + # analyze | |
470 | +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum | |
471 | +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze | |
472 | +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum | |
473 | + # (change requires restart) | |
474 | +#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age | |
475 | + # before forced vacuum | |
476 | + # (change requires restart) | |
477 | +#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for | |
478 | + # autovacuum, in milliseconds; | |
479 | + # -1 means use vacuum_cost_delay | |
480 | +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for | |
481 | + # autovacuum, -1 means use | |
482 | + # vacuum_cost_limit | |
483 | + | |
484 | + | |
485 | +#------------------------------------------------------------------------------ | |
486 | +# CLIENT CONNECTION DEFAULTS | |
487 | +#------------------------------------------------------------------------------ | |
488 | + | |
489 | +# - Statement Behavior - | |
490 | + | |
491 | +#search_path = '"$user",public' # schema names | |
492 | +#default_tablespace = '' # a tablespace name, '' uses the default | |
493 | +#temp_tablespaces = '' # a list of tablespace names, '' uses | |
494 | + # only default tablespace | |
495 | +#check_function_bodies = on | |
496 | +#default_transaction_isolation = 'read committed' | |
497 | +#default_transaction_read_only = off | |
498 | +#default_transaction_deferrable = off | |
499 | +#session_replication_role = 'origin' | |
500 | +#statement_timeout = 0 # in milliseconds, 0 is disabled | |
501 | +#lock_timeout = 0 # in milliseconds, 0 is disabled | |
502 | +#vacuum_freeze_min_age = 50000000 | |
503 | +#vacuum_freeze_table_age = 150000000 | |
504 | +#vacuum_multixact_freeze_min_age = 5000000 | |
505 | +#vacuum_multixact_freeze_table_age = 150000000 | |
506 | +#bytea_output = 'hex' # hex, escape | |
507 | +#xmlbinary = 'base64' | |
508 | +#xmloption = 'content' | |
509 | +#gin_fuzzy_search_limit = 0 | |
510 | + | |
511 | +# - Locale and Formatting - | |
512 | + | |
513 | +datestyle = 'iso, mdy' | |
514 | +#intervalstyle = 'postgres' | |
515 | +timezone = 'Brazil/East' | |
516 | +#timezone_abbreviations = 'Default' # Select the set of available time zone | |
517 | + # abbreviations. Currently, there are | |
518 | + # Default | |
519 | + # Australia (historical usage) | |
520 | + # India | |
521 | + # You can create your own file in | |
522 | + # share/timezonesets/. | |
523 | +#extra_float_digits = 0 # min -15, max 3 | |
524 | +#client_encoding = sql_ascii # actually, defaults to database | |
525 | + # encoding | |
526 | + | |
527 | +# These settings are initialized by initdb, but they can be changed. | |
528 | +lc_messages = 'en_US.UTF-8' # locale for system error message | |
529 | + # strings | |
530 | +lc_monetary = 'en_US.UTF-8' # locale for monetary formatting | |
531 | +lc_numeric = 'en_US.UTF-8' # locale for number formatting | |
532 | +lc_time = 'en_US.UTF-8' # locale for time formatting | |
533 | + | |
534 | +# default configuration for text search | |
535 | +default_text_search_config = 'pg_catalog.english' | |
536 | + | |
537 | +# - Other Defaults - | |
538 | + | |
539 | +#dynamic_library_path = '$libdir' | |
540 | +#local_preload_libraries = '' | |
541 | + | |
542 | + | |
543 | +#------------------------------------------------------------------------------ | |
544 | +# LOCK MANAGEMENT | |
545 | +#------------------------------------------------------------------------------ | |
546 | + | |
547 | +#deadlock_timeout = 1s | |
548 | +#max_locks_per_transaction = 64 # min 10 | |
549 | + # (change requires restart) | |
550 | +# Note: Each lock table slot uses ~270 bytes of shared memory, and there are | |
551 | +# max_locks_per_transaction * (max_connections + max_prepared_transactions) | |
552 | +# lock table slots. | |
553 | +#max_pred_locks_per_transaction = 64 # min 10 | |
554 | + # (change requires restart) | |
555 | + | |
556 | + | |
557 | +#------------------------------------------------------------------------------ | |
558 | +# VERSION/PLATFORM COMPATIBILITY | |
559 | +#------------------------------------------------------------------------------ | |
560 | + | |
561 | +# - Previous PostgreSQL Versions - | |
562 | + | |
563 | +#array_nulls = on | |
564 | +#backslash_quote = safe_encoding # on, off, or safe_encoding | |
565 | +#default_with_oids = off | |
566 | +#escape_string_warning = on | |
567 | +#lo_compat_privileges = off | |
568 | +#quote_all_identifiers = off | |
569 | +#sql_inheritance = on | |
570 | +#standard_conforming_strings = on | |
571 | +#synchronize_seqscans = on | |
572 | + | |
573 | +# - Other Platforms and Clients - | |
574 | + | |
575 | +#transform_null_equals = off | |
576 | + | |
577 | + | |
578 | +#------------------------------------------------------------------------------ | |
579 | +# ERROR HANDLING | |
580 | +#------------------------------------------------------------------------------ | |
581 | + | |
582 | +#exit_on_error = off # terminate session on any error? | |
583 | +#restart_after_crash = on # reinitialize after backend crash? | |
584 | + | |
585 | + | |
586 | +#------------------------------------------------------------------------------ | |
587 | +# CONFIG FILE INCLUDES | |
588 | +#------------------------------------------------------------------------------ | |
589 | + | |
590 | +# These options allow settings to be loaded from files other than the | |
591 | +# default postgresql.conf. | |
592 | + | |
593 | +#include_dir = 'conf.d' # include files ending in '.conf' from | |
594 | + # directory 'conf.d' | |
595 | +#include_if_exists = 'exists.conf' # include file only if it exists | |
596 | +#include = 'special.conf' # include file | |
597 | + | |
598 | + | |
599 | +#------------------------------------------------------------------------------ | |
600 | +# CUSTOMIZED OPTIONS | |
601 | +#------------------------------------------------------------------------------ | |
602 | + | |
603 | +# Add settings for extensions here | ... | ... |
... | ... | @@ -0,0 +1,602 @@ |
1 | +################################################# | |
2 | +######## Arquivo Gerenciado pelo Puppet ######### | |
3 | +######## !!!!!! NAO EDITE DIRETAMENTE !!!!!!!! ## | |
4 | +######## Edite na paste de templates ############ | |
5 | +################################################# | |
6 | +# ----------------------------- | |
7 | +# PostgreSQL configuration file | |
8 | +# ----------------------------- | |
9 | +# | |
10 | +# This file consists of lines of the form: | |
11 | +# | |
12 | +# name = value | |
13 | +# | |
14 | +# (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
15 | +# "#" anywhere on a line. The complete list of parameter names and allowed | |
16 | +# values can be found in the PostgreSQL documentation. | |
17 | +# | |
18 | +# The commented-out settings shown in this file represent the default values. | |
19 | +# Re-commenting a setting is NOT sufficient to revert it to the default value; | |
20 | +# you need to reload the server. | |
21 | +# | |
22 | +# This file is read on server startup and when the server receives a SIGHUP | |
23 | +# signal. If you edit the file on a running system, you have to SIGHUP the | |
24 | +# server for the changes to take effect, or use "pg_ctl reload". Some | |
25 | +# parameters, which are marked below, require a server shutdown and restart to | |
26 | +# take effect. | |
27 | +# | |
28 | +# Any parameter can also be given as a command-line option to the server, e.g., | |
29 | +# "postgres -c log_connections=on". Some parameters can be changed at run time | |
30 | +# with the "SET" SQL command. | |
31 | +# | |
32 | +# Memory units: kB = kilobytes Time units: ms = milliseconds | |
33 | +# MB = megabytes s = seconds | |
34 | +# GB = gigabytes min = minutes | |
35 | +# h = hours | |
36 | +# d = days | |
37 | + | |
38 | + | |
39 | +#------------------------------------------------------------------------------ | |
40 | +# FILE LOCATIONS | |
41 | +#------------------------------------------------------------------------------ | |
42 | + | |
43 | +# The default values of these variables are driven from the -D command-line | |
44 | +# option or PGDATA environment variable, represented here as ConfigDir. | |
45 | + | |
46 | +data_directory = '/var/lib/postgresql/9.3/main' # use data in another directory | |
47 | + # (change requires restart) | |
48 | +hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file | |
49 | + # (change requires restart) | |
50 | +ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file | |
51 | + # (change requires restart) | |
52 | + | |
53 | +# If external_pid_file is not explicitly set, no extra PID file is written. | |
54 | +external_pid_file = '/var/run/postgresql/9.3-main.pid' # write an extra PID file | |
55 | + # (change requires restart) | |
56 | + | |
57 | + | |
58 | +#------------------------------------------------------------------------------ | |
59 | +# CONNECTIONS AND AUTHENTICATION | |
60 | +#------------------------------------------------------------------------------ | |
61 | + | |
62 | +# - Connection Settings - | |
63 | + | |
64 | +listen_addresses = '*' # what IP address(es) to listen on; | |
65 | + # comma-separated list of addresses; | |
66 | + # defaults to 'localhost'; use '*' for all | |
67 | + # (change requires restart) | |
68 | +port = <%= @db_port %> # (change requires restart) | |
69 | +max_connections = 100 # (change requires restart) | |
70 | +# Note: Increasing max_connections costs ~400 bytes of shared memory per | |
71 | +# connection slot, plus lock space (see max_locks_per_transaction). | |
72 | +#superuser_reserved_connections = 3 # (change requires restart) | |
73 | +unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories | |
74 | + # (change requires restart) | |
75 | +#unix_socket_group = '' # (change requires restart) | |
76 | +#unix_socket_permissions = 0777 # begin with 0 to use octal notation | |
77 | + # (change requires restart) | |
78 | +#bonjour = off # advertise server via Bonjour | |
79 | + # (change requires restart) | |
80 | +#bonjour_name = '' # defaults to the computer name | |
81 | + # (change requires restart) | |
82 | + | |
83 | +# - Security and Authentication - | |
84 | + | |
85 | +#authentication_timeout = 1min # 1s-600s | |
86 | +ssl = true # (change requires restart) | |
87 | +#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers | |
88 | + # (change requires restart) | |
89 | +#ssl_renegotiation_limit = 0 # amount of data between renegotiations | |
90 | +ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) | |
91 | +ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) | |
92 | +#ssl_ca_file = '' # (change requires restart) | |
93 | +#ssl_crl_file = '' # (change requires restart) | |
94 | +#password_encryption = on | |
95 | +#db_user_namespace = off | |
96 | + | |
97 | +# Kerberos and GSSAPI | |
98 | +#krb_server_keyfile = '' | |
99 | +#krb_srvname = 'postgres' # (Kerberos only) | |
100 | +#krb_caseins_users = off | |
101 | + | |
102 | +# - TCP Keepalives - | |
103 | +# see "man 7 tcp" for details | |
104 | + | |
105 | +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; | |
106 | + # 0 selects the system default | |
107 | +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; | |
108 | + # 0 selects the system default | |
109 | +#tcp_keepalives_count = 0 # TCP_KEEPCNT; | |
110 | + # 0 selects the system default | |
111 | + | |
112 | + | |
113 | +#------------------------------------------------------------------------------ | |
114 | +# RESOURCE USAGE (except WAL) | |
115 | +#------------------------------------------------------------------------------ | |
116 | + | |
117 | +# - Memory - | |
118 | + | |
119 | +shared_buffers = 128MB # min 128kB | |
120 | + # (change requires restart) | |
121 | +#temp_buffers = 8MB # min 800kB | |
122 | +#max_prepared_transactions = 0 # zero disables the feature | |
123 | + # (change requires restart) | |
124 | +# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory | |
125 | +# per transaction slot, plus lock space (see max_locks_per_transaction). | |
126 | +# It is not advisable to set max_prepared_transactions nonzero unless you | |
127 | +# actively intend to use prepared transactions. | |
128 | +#work_mem = 1MB # min 64kB | |
129 | +#maintenance_work_mem = 16MB # min 1MB | |
130 | +#max_stack_depth = 2MB # min 100kB | |
131 | + | |
132 | +# - Disk - | |
133 | + | |
134 | +#temp_file_limit = -1 # limits per-session temp file space | |
135 | + # in kB, or -1 for no limit | |
136 | + | |
137 | +# - Kernel Resource Usage - | |
138 | + | |
139 | +#max_files_per_process = 1000 # min 25 | |
140 | + # (change requires restart) | |
141 | +#shared_preload_libraries = '' # (change requires restart) | |
142 | + | |
143 | +# - Cost-Based Vacuum Delay - | |
144 | + | |
145 | +#vacuum_cost_delay = 0 # 0-100 milliseconds | |
146 | +#vacuum_cost_page_hit = 1 # 0-10000 credits | |
147 | +#vacuum_cost_page_miss = 10 # 0-10000 credits | |
148 | +#vacuum_cost_page_dirty = 20 # 0-10000 credits | |
149 | +#vacuum_cost_limit = 200 # 1-10000 credits | |
150 | + | |
151 | +# - Background Writer - | |
152 | + | |
153 | +#bgwriter_delay = 200ms # 10-10000ms between rounds | |
154 | +#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round | |
155 | +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round | |
156 | + | |
157 | +# - Asynchronous Behavior - | |
158 | + | |
159 | +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching | |
160 | + | |
161 | + | |
162 | +#------------------------------------------------------------------------------ | |
163 | +# WRITE AHEAD LOG | |
164 | +#------------------------------------------------------------------------------ | |
165 | + | |
166 | +# - Settings - | |
167 | + | |
168 | +#wal_level = minimal # minimal, archive, or hot_standby | |
169 | + # (change requires restart) | |
170 | +#fsync = on # turns forced synchronization on or off | |
171 | +#synchronous_commit = on # synchronization level; | |
172 | + # off, local, remote_write, or on | |
173 | +#wal_sync_method = fsync # the default is the first option | |
174 | + # supported by the operating system: | |
175 | + # open_datasync | |
176 | + # fdatasync (default on Linux) | |
177 | + # fsync | |
178 | + # fsync_writethrough | |
179 | + # open_sync | |
180 | +#full_page_writes = on # recover from partial page writes | |
181 | +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers | |
182 | + # (change requires restart) | |
183 | +#wal_writer_delay = 200ms # 1-10000 milliseconds | |
184 | + | |
185 | +#commit_delay = 0 # range 0-100000, in microseconds | |
186 | +#commit_siblings = 5 # range 1-1000 | |
187 | + | |
188 | +# - Checkpoints - | |
189 | + | |
190 | +#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each | |
191 | +#checkpoint_timeout = 5min # range 30s-1h | |
192 | +#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 | |
193 | +#checkpoint_warning = 30s # 0 disables | |
194 | + | |
195 | +# - Archiving - | |
196 | + | |
197 | +#archive_mode = off # allows archiving to be done | |
198 | + # (change requires restart) | |
199 | +#archive_command = '' # command to use to archive a logfile segment | |
200 | + # placeholders: %p = path of file to archive | |
201 | + # %f = file name only | |
202 | + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' | |
203 | +#archive_timeout = 0 # force a logfile segment switch after this | |
204 | + # number of seconds; 0 disables | |
205 | + | |
206 | + | |
207 | +#------------------------------------------------------------------------------ | |
208 | +# REPLICATION | |
209 | +#------------------------------------------------------------------------------ | |
210 | + | |
211 | +# - Sending Server(s) - | |
212 | + | |
213 | +# Set these on the master and on any standby that will send replication data. | |
214 | + | |
215 | +#max_wal_senders = 0 # max number of walsender processes | |
216 | + # (change requires restart) | |
217 | +#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables | |
218 | +#wal_sender_timeout = 60s # in milliseconds; 0 disables | |
219 | + | |
220 | +# - Master Server - | |
221 | + | |
222 | +# These settings are ignored on a standby server. | |
223 | + | |
224 | +#synchronous_standby_names = '' # standby servers that provide sync rep | |
225 | + # comma-separated list of application_name | |
226 | + # from standby(s); '*' = all | |
227 | +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed | |
228 | + | |
229 | +# - Standby Servers - | |
230 | + | |
231 | +# These settings are ignored on a master server. | |
232 | + | |
233 | +#hot_standby = off # "on" allows queries during recovery | |
234 | + # (change requires restart) | |
235 | +#max_standby_archive_delay = 30s # max delay before canceling queries | |
236 | + # when reading WAL from archive; | |
237 | + # -1 allows indefinite delay | |
238 | +#max_standby_streaming_delay = 30s # max delay before canceling queries | |
239 | + # when reading streaming WAL; | |
240 | + # -1 allows indefinite delay | |
241 | +#wal_receiver_status_interval = 10s # send replies at least this often | |
242 | + # 0 disables | |
243 | +#hot_standby_feedback = off # send info from standby to prevent | |
244 | + # query conflicts | |
245 | +#wal_receiver_timeout = 60s # time that receiver waits for | |
246 | + # communication from master | |
247 | + # in milliseconds; 0 disables | |
248 | + | |
249 | + | |
250 | +#------------------------------------------------------------------------------ | |
251 | +# QUERY TUNING | |
252 | +#------------------------------------------------------------------------------ | |
253 | + | |
254 | +# - Planner Method Configuration - | |
255 | + | |
256 | +#enable_bitmapscan = on | |
257 | +#enable_hashagg = on | |
258 | +#enable_hashjoin = on | |
259 | +#enable_indexscan = on | |
260 | +#enable_indexonlyscan = on | |
261 | +#enable_material = on | |
262 | +#enable_mergejoin = on | |
263 | +#enable_nestloop = on | |
264 | +#enable_seqscan = on | |
265 | +#enable_sort = on | |
266 | +#enable_tidscan = on | |
267 | + | |
268 | +# - Planner Cost Constants - | |
269 | + | |
270 | +#seq_page_cost = 1.0 # measured on an arbitrary scale | |
271 | +#random_page_cost = 4.0 # same scale as above | |
272 | +#cpu_tuple_cost = 0.01 # same scale as above | |
273 | +#cpu_index_tuple_cost = 0.005 # same scale as above | |
274 | +#cpu_operator_cost = 0.0025 # same scale as above | |
275 | +#effective_cache_size = 128MB | |
276 | + | |
277 | +# - Genetic Query Optimizer - | |
278 | + | |
279 | +#geqo = on | |
280 | +#geqo_threshold = 12 | |
281 | +#geqo_effort = 5 # range 1-10 | |
282 | +#geqo_pool_size = 0 # selects default based on effort | |
283 | +#geqo_generations = 0 # selects default based on effort | |
284 | +#geqo_selection_bias = 2.0 # range 1.5-2.0 | |
285 | +#geqo_seed = 0.0 # range 0.0-1.0 | |
286 | + | |
287 | +# - Other Planner Options - | |
288 | + | |
289 | +#default_statistics_target = 100 # range 1-10000 | |
290 | +#constraint_exclusion = partition # on, off, or partition | |
291 | +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 | |
292 | +#from_collapse_limit = 8 | |
293 | +#join_collapse_limit = 8 # 1 disables collapsing of explicit | |
294 | + # JOIN clauses | |
295 | + | |
296 | + | |
297 | +#------------------------------------------------------------------------------ | |
298 | +# ERROR REPORTING AND LOGGING | |
299 | +#------------------------------------------------------------------------------ | |
300 | + | |
301 | +# - Where to Log - | |
302 | + | |
303 | +#log_destination = 'stderr' # Valid values are combinations of | |
304 | + # stderr, csvlog, syslog, and eventlog, | |
305 | + # depending on platform. csvlog | |
306 | + # requires logging_collector to be on. | |
307 | + | |
308 | +# This is used when logging to stderr: | |
309 | +#logging_collector = off # Enable capturing of stderr and csvlog | |
310 | + # into log files. Required to be on for | |
311 | + # csvlogs. | |
312 | + # (change requires restart) | |
313 | + | |
314 | +# These are only used if logging_collector is on: | |
315 | +#log_directory = 'pg_log' # directory where log files are written, | |
316 | + # can be absolute or relative to PGDATA | |
317 | +#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, | |
318 | + # can include strftime() escapes | |
319 | +#log_file_mode = 0600 # creation mode for log files, | |
320 | + # begin with 0 to use octal notation | |
321 | +#log_truncate_on_rotation = off # If on, an existing log file with the | |
322 | + # same name as the new log file will be | |
323 | + # truncated rather than appended to. | |
324 | + # But such truncation only occurs on | |
325 | + # time-driven rotation, not on restarts | |
326 | + # or size-driven rotation. Default is | |
327 | + # off, meaning append to existing files | |
328 | + # in all cases. | |
329 | +#log_rotation_age = 1d # Automatic rotation of logfiles will | |
330 | + # happen after that time. 0 disables. | |
331 | +#log_rotation_size = 10MB # Automatic rotation of logfiles will | |
332 | + # happen after that much log output. | |
333 | + # 0 disables. | |
334 | + | |
335 | +# These are relevant when logging to syslog: | |
336 | +#syslog_facility = 'LOCAL0' | |
337 | +#syslog_ident = 'postgres' | |
338 | + | |
339 | +# This is only relevant when logging to eventlog (win32): | |
340 | +#event_source = 'PostgreSQL' | |
341 | + | |
342 | +# - When to Log - | |
343 | + | |
344 | +#client_min_messages = notice # values in order of decreasing detail: | |
345 | + # debug5 | |
346 | + # debug4 | |
347 | + # debug3 | |
348 | + # debug2 | |
349 | + # debug1 | |
350 | + # log | |
351 | + # notice | |
352 | + # warning | |
353 | + # error | |
354 | + | |
355 | +#log_min_messages = warning # values in order of decreasing detail: | |
356 | + # debug5 | |
357 | + # debug4 | |
358 | + # debug3 | |
359 | + # debug2 | |
360 | + # debug1 | |
361 | + # info | |
362 | + # notice | |
363 | + # warning | |
364 | + # error | |
365 | + # log | |
366 | + # fatal | |
367 | + # panic | |
368 | + | |
369 | +#log_min_error_statement = error # values in order of decreasing detail: | |
370 | + # debug5 | |
371 | + # debug4 | |
372 | + # debug3 | |
373 | + # debug2 | |
374 | + # debug1 | |
375 | + # info | |
376 | + # notice | |
377 | + # warning | |
378 | + # error | |
379 | + # log | |
380 | + # fatal | |
381 | + # panic (effectively off) | |
382 | + | |
383 | +#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements | |
384 | + # and their durations, > 0 logs only | |
385 | + # statements running at least this number | |
386 | + # of milliseconds | |
387 | + | |
388 | + | |
389 | +# - What to Log - | |
390 | + | |
391 | +#debug_print_parse = off | |
392 | +#debug_print_rewritten = off | |
393 | +#debug_print_plan = off | |
394 | +#debug_pretty_print = on | |
395 | +#log_checkpoints = off | |
396 | +#log_connections = off | |
397 | +#log_disconnections = off | |
398 | +#log_duration = off | |
399 | +#log_error_verbosity = default # terse, default, or verbose messages | |
400 | +#log_hostname = off | |
401 | +log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values: | |
402 | + # %a = application name | |
403 | + # %u = user name | |
404 | + # %d = database name | |
405 | + # %r = remote host and port | |
406 | + # %h = remote host | |
407 | + # %p = process ID | |
408 | + # %t = timestamp without milliseconds | |
409 | + # %m = timestamp with milliseconds | |
410 | + # %i = command tag | |
411 | + # %e = SQL state | |
412 | + # %c = session ID | |
413 | + # %l = session line number | |
414 | + # %s = session start timestamp | |
415 | + # %v = virtual transaction ID | |
416 | + # %x = transaction ID (0 if none) | |
417 | + # %q = stop here in non-session | |
418 | + # processes | |
419 | + # %% = '%' | |
420 | + # e.g. '<%u%%%d> ' | |
421 | +#log_lock_waits = off # log lock waits >= deadlock_timeout | |
422 | +#log_statement = 'none' # none, ddl, mod, all | |
423 | +#log_temp_files = -1 # log temporary files equal or larger | |
424 | + # than the specified size in kilobytes; | |
425 | + # -1 disables, 0 logs all temp files | |
426 | +log_timezone = 'UTC' | |
427 | + | |
428 | + | |
429 | +#------------------------------------------------------------------------------ | |
430 | +# RUNTIME STATISTICS | |
431 | +#------------------------------------------------------------------------------ | |
432 | + | |
433 | +# - Query/Index Statistics Collector - | |
434 | + | |
435 | +#track_activities = on | |
436 | +#track_counts = on | |
437 | +#track_io_timing = off | |
438 | +#track_functions = none # none, pl, all | |
439 | +#track_activity_query_size = 1024 # (change requires restart) | |
440 | +#update_process_title = on | |
441 | +stats_temp_directory = '/var/run/postgresql/9.3-main.pg_stat_tmp' | |
442 | + | |
443 | + | |
444 | +# - Statistics Monitoring - | |
445 | + | |
446 | +#log_parser_stats = off | |
447 | +#log_planner_stats = off | |
448 | +#log_executor_stats = off | |
449 | +#log_statement_stats = off | |
450 | + | |
451 | + | |
452 | +#------------------------------------------------------------------------------ | |
453 | +# AUTOVACUUM PARAMETERS | |
454 | +#------------------------------------------------------------------------------ | |
455 | + | |
456 | +#autovacuum = on # Enable autovacuum subprocess? 'on' | |
457 | + # requires track_counts to also be on. | |
458 | +#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and | |
459 | + # their durations, > 0 logs only | |
460 | + # actions running at least this number | |
461 | + # of milliseconds. | |
462 | +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses | |
463 | + # (change requires restart) | |
464 | +#autovacuum_naptime = 1min # time between autovacuum runs | |
465 | +#autovacuum_vacuum_threshold = 50 # min number of row updates before | |
466 | + # vacuum | |
467 | +#autovacuum_analyze_threshold = 50 # min number of row updates before | |
468 | + # analyze | |
469 | +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum | |
470 | +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze | |
471 | +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum | |
472 | + # (change requires restart) | |
473 | +#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age | |
474 | + # before forced vacuum | |
475 | + # (change requires restart) | |
476 | +#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for | |
477 | + # autovacuum, in milliseconds; | |
478 | + # -1 means use vacuum_cost_delay | |
479 | +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for | |
480 | + # autovacuum, -1 means use | |
481 | + # vacuum_cost_limit | |
482 | + | |
483 | + | |
484 | +#------------------------------------------------------------------------------ | |
485 | +# CLIENT CONNECTION DEFAULTS | |
486 | +#------------------------------------------------------------------------------ | |
487 | + | |
488 | +# - Statement Behavior - | |
489 | + | |
490 | +#search_path = '"$user",public' # schema names | |
491 | +#default_tablespace = '' # a tablespace name, '' uses the default | |
492 | +#temp_tablespaces = '' # a list of tablespace names, '' uses | |
493 | + # only default tablespace | |
494 | +#check_function_bodies = on | |
495 | +#default_transaction_isolation = 'read committed' | |
496 | +#default_transaction_read_only = off | |
497 | +#default_transaction_deferrable = off | |
498 | +#session_replication_role = 'origin' | |
499 | +#statement_timeout = 0 # in milliseconds, 0 is disabled | |
500 | +#lock_timeout = 0 # in milliseconds, 0 is disabled | |
501 | +#vacuum_freeze_min_age = 50000000 | |
502 | +#vacuum_freeze_table_age = 150000000 | |
503 | +#vacuum_multixact_freeze_min_age = 5000000 | |
504 | +#vacuum_multixact_freeze_table_age = 150000000 | |
505 | +#bytea_output = 'hex' # hex, escape | |
506 | +#xmlbinary = 'base64' | |
507 | +#xmloption = 'content' | |
508 | +#gin_fuzzy_search_limit = 0 | |
509 | + | |
510 | +# - Locale and Formatting - | |
511 | + | |
512 | +datestyle = 'iso, mdy' | |
513 | +#intervalstyle = 'postgres' | |
514 | +timezone = 'UTC' | |
515 | +#timezone_abbreviations = 'Default' # Select the set of available time zone | |
516 | + # abbreviations. Currently, there are | |
517 | + # Default | |
518 | + # Australia (historical usage) | |
519 | + # India | |
520 | + # You can create your own file in | |
521 | + # share/timezonesets/. | |
522 | +#extra_float_digits = 0 # min -15, max 3 | |
523 | +#client_encoding = sql_ascii # actually, defaults to database | |
524 | + # encoding | |
525 | + | |
526 | +# These settings are initialized by initdb, but they can be changed. | |
527 | +lc_messages = 'en_US.UTF-8' # locale for system error message | |
528 | + # strings | |
529 | +lc_monetary = 'en_US.UTF-8' # locale for monetary formatting | |
530 | +lc_numeric = 'en_US.UTF-8' # locale for number formatting | |
531 | +lc_time = 'en_US.UTF-8' # locale for time formatting | |
532 | + | |
533 | +# default configuration for text search | |
534 | +default_text_search_config = 'pg_catalog.english' | |
535 | + | |
536 | +# - Other Defaults - | |
537 | + | |
538 | +#dynamic_library_path = '$libdir' | |
539 | +#local_preload_libraries = '' | |
540 | + | |
541 | + | |
542 | +#------------------------------------------------------------------------------ | |
543 | +# LOCK MANAGEMENT | |
544 | +#------------------------------------------------------------------------------ | |
545 | + | |
546 | +#deadlock_timeout = 1s | |
547 | +#max_locks_per_transaction = 64 # min 10 | |
548 | + # (change requires restart) | |
549 | +# Note: Each lock table slot uses ~270 bytes of shared memory, and there are | |
550 | +# max_locks_per_transaction * (max_connections + max_prepared_transactions) | |
551 | +# lock table slots. | |
552 | +#max_pred_locks_per_transaction = 64 # min 10 | |
553 | + # (change requires restart) | |
554 | + | |
555 | + | |
556 | +#------------------------------------------------------------------------------ | |
557 | +# VERSION/PLATFORM COMPATIBILITY | |
558 | +#------------------------------------------------------------------------------ | |
559 | + | |
560 | +# - Previous PostgreSQL Versions - | |
561 | + | |
562 | +#array_nulls = on | |
563 | +#backslash_quote = safe_encoding # on, off, or safe_encoding | |
564 | +#default_with_oids = off | |
565 | +#escape_string_warning = on | |
566 | +#lo_compat_privileges = off | |
567 | +#quote_all_identifiers = off | |
568 | +#sql_inheritance = on | |
569 | +#standard_conforming_strings = on | |
570 | +#synchronize_seqscans = on | |
571 | + | |
572 | +# - Other Platforms and Clients - | |
573 | + | |
574 | +#transform_null_equals = off | |
575 | + | |
576 | + | |
577 | +#------------------------------------------------------------------------------ | |
578 | +# ERROR HANDLING | |
579 | +#------------------------------------------------------------------------------ | |
580 | + | |
581 | +#exit_on_error = off # terminate session on any error? | |
582 | +#restart_after_crash = on # reinitialize after backend crash? | |
583 | + | |
584 | + | |
585 | +#------------------------------------------------------------------------------ | |
586 | +# CONFIG FILE INCLUDES | |
587 | +#------------------------------------------------------------------------------ | |
588 | + | |
589 | +# These options allow settings to be loaded from files other than the | |
590 | +# default postgresql.conf. | |
591 | + | |
592 | +#include_dir = 'conf.d' # include files ending in '.conf' from | |
593 | + # directory 'conf.d' | |
594 | +#include_if_exists = 'exists.conf' # include file only if it exists | |
595 | +#include = 'special.conf' # include file | |
596 | + | |
597 | + | |
598 | +#------------------------------------------------------------------------------ | |
599 | +# CUSTOMIZED OPTIONS | |
600 | +#------------------------------------------------------------------------------ | |
601 | + | |
602 | +# Add settings for extensions here | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +# The baseline for module testing used by Puppet Labs is that each manifest | |
2 | +# should have a corresponding test manifest that declares that class or defined | |
3 | +# type. | |
4 | +# | |
5 | +# Tests are then run by using puppet apply --noop (to check for compilation | |
6 | +# errors and view a log of events) or by fully applying the test in a virtual | |
7 | +# environment (to compare the resulting system state to the desired state). | |
8 | +# | |
9 | +# Learn more about module testing here: | |
10 | +# http://docs.puppetlabs.com/guides/tests_smoke.html | |
11 | +# | |
12 | +include simec | ... | ... |