From 7db6f985642ccdaec4b94fb63b8a296d264f03e3 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 8 Sep 2014 21:22:12 -0300 Subject: [PATCH] =?UTF-8?q?Configura=C3=A7=C3=A3o=20puppet:=20pacotes,=20u?= =?UTF-8?q?ser,=20group,=20diret=C3=B3rios,=20repo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 3 ++- puppet/bootstrap.sh | 3 +++ puppet/manifests/site.pp | 46 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 puppet/bootstrap.sh 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', } +