|
@ -3,17 +3,24 @@ group { 'sigi': |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
user { 'sigi': |
|
|
user { 'sigi': |
|
|
ensure => 'present', |
|
|
ensure => 'present', |
|
|
system => 'true', |
|
|
system => true, |
|
|
gid => 'sigi', |
|
|
gid => 'sigi', |
|
|
require => Group['sigi'] |
|
|
require => Group['sigi'] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
package { [ 'git', 'tree', 'python-pip', 'python-dev', 'python-psycopg2', |
|
|
package { [ 'git', 'tree', 'python-psycopg2', 'supervisor', 'memcached', ]: } |
|
|
'supervisor', 'memcached', ]: } |
|
|
|
|
|
|
|
|
|
|
|
$sigi_dir = '/srv/sigi' |
|
|
$sigi_dir = '/srv/sigi' |
|
|
|
|
|
|
|
|
|
|
|
vcsrepo { $sigi_dir: |
|
|
|
|
|
ensure => latest, |
|
|
|
|
|
provider => git, |
|
|
|
|
|
source => 'https://github.com/interlegis/sigi.git', |
|
|
|
|
|
revision => 'producao', |
|
|
|
|
|
require => Package['git'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
file { [ |
|
|
file { [ |
|
|
'/var/log/sigi', |
|
|
'/var/log/sigi', |
|
|
'/var/run/sigi', |
|
|
'/var/run/sigi', |
|
@ -21,9 +28,10 @@ file { [ |
|
|
"${sigi_dir}/media/apps", |
|
|
"${sigi_dir}/media/apps", |
|
|
"${sigi_dir}/media/apps/metas", |
|
|
"${sigi_dir}/media/apps/metas", |
|
|
]: |
|
|
]: |
|
|
ensure => 'directory', |
|
|
ensure => 'directory', |
|
|
owner => 'sigi', |
|
|
owner => 'sigi', |
|
|
group => 'sigi', |
|
|
group => 'sigi', |
|
|
|
|
|
require => Vcsrepo[$sigi_dir], |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# TODO A pasta "${sigi_dir}/media" deve ser compartilhada entre instancias de cluster |
|
|
# TODO A pasta "${sigi_dir}/media" deve ser compartilhada entre instancias de cluster |
|
@ -32,12 +40,33 @@ file { '/var/log/sigi/sigi-supervisor.log': |
|
|
ensure => file, |
|
|
ensure => file, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
vcsrepo { $sigi_dir: |
|
|
########################################################################### |
|
|
ensure => latest, |
|
|
# PYTHON |
|
|
provider => git, |
|
|
|
|
|
source => 'https://github.com/interlegis/sigi.git', |
|
|
if !defined(Class['python']) { |
|
|
revision => 'producao', |
|
|
class { 'python': |
|
|
require => Package['git'], |
|
|
version => 'system', |
|
|
|
|
|
dev => true, |
|
|
|
|
|
virtualenv => true, |
|
|
|
|
|
pip => true, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$python_ldap_deps = ['libldap2-dev', 'libsasl2-dev', 'libssl-dev'] |
|
|
|
|
|
|
|
|
|
|
|
package { $python_ldap_deps: } |
|
|
|
|
|
|
|
|
|
|
|
$sigi_venv_dir = '/srv/.virtualenvs/sigi' |
|
|
|
|
|
|
|
|
|
|
|
file { ['/srv/.virtualenvs',]: |
|
|
|
|
|
ensure => 'directory', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
python::virtualenv { $sigi_venv_dir : |
|
|
|
|
|
requirements => "${sigi_dir}/requirements/producao.txt", |
|
|
|
|
|
require => [ File['/srv/.virtualenvs'], |
|
|
|
|
|
Vcsrepo[$sigi_dir], |
|
|
|
|
|
Package[$python_ldap_deps] ] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
########################################################################### |
|
|
########################################################################### |
|
|