diff --git a/Vagrantfile b/Vagrantfile index 883a652..228df1e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.network :forwarded_port, guest: 80, host: 8080 - # config.vm.provision :shell, :path => "puppet/bootstrap.sh" + config.vm.provision :shell, :path => "puppet/bootstrap.sh" + config.vm.provision :shell, :path => "puppet/puppet_module_install_from_github.sh", :args => "jfryman-nginx interlegis/puppet-nginx" diff --git a/puppet/bootstrap.sh b/puppet/bootstrap.sh new file mode 100644 index 0000000..7a1ab09 --- /dev/null +++ b/puppet/bootstrap.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +puppet module list | grep puppetlabs-vcsrepo || puppet module install puppetlabs/vcsrepo diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 4b33323..093c296 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -1,5 +1,51 @@ +group { 'sigi': + ensure => 'present', +} + +user { 'sigi': + ensure => 'present', + system => 'true', + gid => 'sigi', + require => Group['sigi'] +} + +package { [ 'git', 'tree', + 'python-pip', 'python-dev', 'python-psycopg2', + 'supervisor', 'memcached', + ]: } + +$sigi_dir = '/srv/sigi' + +file { [ + '/var/log/sigi', + '/var/run/sigi', + "${sigi_dir}/media", # Se for fazer cluster, essa pasta deve ser a mesma entre as instâncias + "${sigi_dir}/media/apps", + "${sigi_dir}/media/apps/metas", + ]: + ensure => 'directory', + owner => 'sigi', + group => 'sigi', +} + +file { '/var/log/sigi/sigi-supervisor.log': + ensure => file, +} + +vcsrepo { $sigi_dir: + ensure => latest, + provider => git, + source => 'https://github.com/interlegis/sigi.git', + revision => 'producao', + require => Package['git'], +} + +########################################################################### +# NGINX + class { 'nginx': } nginx::resource::vhost { 'localhost': www_root => '/vagrant/www_temp', } +