Commit ab5c1ba4 authored by MARGERY David's avatar MARGERY David
Browse files

Adapt puppet rule to usage outside vagrant

parent 21901475
...@@ -100,6 +100,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -100,6 +100,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
puppet.environment = 'development' puppet.environment = 'development'
puppet.environment_path = "puppet" puppet.environment_path = "puppet"
puppet.facter = { puppet.facter = {
"owner" => ENV['OWNER']||'vagrant',
"workspace" => ENV['WORKSPACE']||'/vagrant',
"developer" => ENV['DEVELOPER']||'ajenkins', "developer" => ENV['DEVELOPER']||'ajenkins',
"oardbsite" => ENV['OAR_DB_SITE']||'rennes' "oardbsite" => ENV['OAR_DB_SITE']||'rennes'
} }
......
...@@ -40,11 +40,11 @@ class development { ...@@ -40,11 +40,11 @@ class development {
exec{ "Run bundle install": exec{ "Run bundle install":
user => root, user => root,
group => root, group => root,
cwd => "/vagrant", cwd => $workspace",
command => "/bin/su -c '/usr/local/bin/bundle install' vagrant", command => "/bin/su -c '/usr/local/bin/bundle install' $owner",
require => [Exec["install bundler"],Package['libxml2-dev','libxslt-dev']], require => [Exec["install bundler"],Package['libxml2-dev','libxslt-dev']],
logoutput => true, logoutput => true,
unless => "/bin/su -c '/usr/local/bin/bundle show' vagrant" unless => "/bin/su -c '/usr/local/bin/bundle show' $owner"
} }
......
...@@ -35,10 +35,10 @@ class apache { ...@@ -35,10 +35,10 @@ class apache {
} }
file { file {
'/vagrant/lib/tasks/tunneling.rake': "$workspace/lib/tasks/tunneling.rake":
mode => '0644', mode => '0644',
owner => vagrant, owner => $owner,
group => vagrant, group => $owner,
content => template('apache/tunneling.rake.erb'), content => template('apache/tunneling.rake.erb'),
} }
...@@ -55,7 +55,7 @@ class apache { ...@@ -55,7 +55,7 @@ class apache {
} }
exec { "Generate certificate authority": exec { "Generate certificate authority":
command => "/usr/bin/openssl req -new -x509 -days 3650 -keyform PEM -keyout /etc/ssl/private/cakey.pem -outform PEM -out /etc/ssl/certs/ca.pem -passout file:/etc/ssl/secret -batch -subj \"/C=FR/ST=Bretagne/L=Rennes/O=dev/OU=Grid5000/CN=vagrant/emailAddress=support-staff@lists.grid5000.fr\"", command => "/usr/bin/openssl req -new -x509 -days 3650 -keyform PEM -keyout /etc/ssl/private/cakey.pem -outform PEM -out /etc/ssl/certs/ca.pem -passout file:/etc/ssl/secret -batch -subj \"/C=FR/ST=Bretagne/L=Rennes/O=dev/OU=Grid5000/CN=$owner/emailAddress=support-staff@lists.grid5000.fr\"",
user => root, group => root, user => root, group => root,
require => File["/etc/ssl/secret"], require => File["/etc/ssl/secret"],
creates => "/etc/ssl/private/cakey.pem", creates => "/etc/ssl/private/cakey.pem",
......
...@@ -12,7 +12,7 @@ Listen 8443 ...@@ -12,7 +12,7 @@ Listen 8443
TimeOut 300 TimeOut 300
ServerName <%= @fqdn %> ServerName <%= @fqdn %>
ServerAlias server api.grid5000.fr ServerAlias server api.grid5000.fr
DocumentRoot /vagrant/public DocumentRoot <%= @workspace %>/public
CustomLog /var/log/apache2/api-proxy-dev-ssl.log "%v %h %l %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" CustomLog /var/log/apache2/api-proxy-dev-ssl.log "%v %h %l %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog syslog:local1 ErrorLog syslog:local1
...@@ -46,8 +46,8 @@ Listen 8080 ...@@ -46,8 +46,8 @@ Listen 8080
TimeOut 600 TimeOut 600
ServerName <%= @fqdn %> ServerName <%= @fqdn %>
ServerAlias api.grid5000.fr ServerAlias api.grid5000.fr
DocumentRoot /vagrant/public DocumentRoot <%= @workspace %>/public
<Directory /vagrant/public/ui/javascripts/vendor/exhibitv2> <Directory <%= @workspace %>/public/ui/javascripts/vendor/exhibitv2>
Options -Indexes Options -Indexes
</Directory> </Directory>
# see http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#customlog # see http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#customlog
...@@ -111,7 +111,7 @@ Listen 8080 ...@@ -111,7 +111,7 @@ Listen 8080
<VirtualHost *:4444> <VirtualHost *:4444>
TimeOut 60 TimeOut 60
ServerName <%= @fqdn %> ServerName <%= @fqdn %>
DocumentRoot /vagrant/public DocumentRoot <%= @workspace %>/public
# see http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#customlog # see http://httpd.apache.org/docs/2.0/mod/mod_log_config.html#customlog
CustomLog /var/log/apache2/api-proxy-dev-2.log "%v %h %{X-Api-User-Cn}i %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" CustomLog /var/log/apache2/api-proxy-dev-2.log "%v %h %{X-Api-User-Cn}i %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog syslog:local1 ErrorLog syslog:local1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment