From 2f700939379494ae4c528c55e1b3e11917916569 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 10 Sep 2014 21:17:27 -0300 Subject: [PATCH] Puppet: nginx com arquivos simples (sem usar modulo puppet) --- puppet/manifests/site.pp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 34f8ce7..fbf8d1c 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -125,9 +125,31 @@ exec { 'supervisor_update': ########################################################################### # NGINX -class { 'nginx': } +package { 'nginx': } -nginx::resource::vhost { 'localhost': - www_root => '/vagrant/www_temp', +file { '/etc/nginx/sites-available/sigi.vhost': + ensure => link, + target => "${sigi_dir}/etc/nginx/sites-available/sigi.vhost", + require => [ + Vcsrepo[$sigi_dir], + Package['nginx'] ] +} + +file { '/etc/nginx/sites-enabled/sigi.vhost': + ensure => link, + target => '/etc/nginx/sites-available/sigi.vhost', + require => Package['nginx'], +} + +exec { 'nginx_restart': + command => 'service nginx restart', + refreshonly => true, + subscribe => [ + File['/etc/nginx/sites-enabled/sigi.vhost'], + Vcsrepo[$sigi_dir]], +} + +file { '/etc/nginx/sites-enabled/default': + ensure => absent, }