Browse Source

Configuração puppet: pacotes, user, group, diretórios, repo

producao
Marcio Mazza 10 years ago
parent
commit
7db6f98564
  1. 3
      Vagrantfile
  2. 3
      puppet/bootstrap.sh
  3. 46
      puppet/manifests/site.pp

3
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"

3
puppet/bootstrap.sh

@ -0,0 +1,3 @@
#!/bin/bash
puppet module list | grep puppetlabs-vcsrepo || puppet module install puppetlabs/vcsrepo

46
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',
}

Loading…
Cancel
Save