commit
ab7d0142a6
|
@ -0,0 +1,8 @@
|
||||||
|
require 'rubygems'
|
||||||
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
|
require 'puppet-lint/tasks/puppet-lint'
|
||||||
|
PuppetLint.configuration.fail_on_warnings = true
|
||||||
|
PuppetLint.configuration.send('disable_80chars')
|
||||||
|
PuppetLint.configuration.send('disable_autoloader_layout')
|
||||||
|
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||||
|
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
class phabricator (
|
class phabricator (
|
||||||
$vhost_name = $::fqdn,
|
$vhost_name = $::fqdn,
|
||||||
$phab_dir = "/phabricator",
|
$phab_dir = '/phabricator',
|
||||||
$instance = 'dev',
|
$instance = 'dev',
|
||||||
$mysql_host = 'localhost',
|
$mysql_host = 'localhost',
|
||||||
$mysql_port = 3306,
|
$mysql_port = 3306,
|
||||||
|
@ -17,17 +17,17 @@ class phabricator (
|
||||||
$ssl_chain_file_contents = '' # If left empty puppet will not create file.
|
$ssl_chain_file_contents = '' # If left empty puppet will not create file.
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$instances_dir = "${phab_dir}/instances",
|
$instances_dir = "${phab_dir}/instances"
|
||||||
$instance_dir = "${instances_dir}/${instance}"",
|
$instance_dir = "${instances_dir}/${instance}"
|
||||||
|
|
||||||
$packages = [
|
$packages = [
|
||||||
"php5",
|
'php5',
|
||||||
"php5-mysql",
|
'php5-mysql',
|
||||||
"php5-gd",
|
'php5-gd',
|
||||||
"php5-dev",
|
'php5-dev',
|
||||||
"php5-curl",
|
'php5-curl',
|
||||||
"php-apc",
|
'php-apc',
|
||||||
"php5-cli"
|
'php5-cli'
|
||||||
]
|
]
|
||||||
package { $packages:
|
package { $packages:
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
|
@ -82,8 +82,7 @@ class phabricator (
|
||||||
vcsrepo { "${instance_dir}/phabricator":
|
vcsrepo { "${instance_dir}/phabricator":
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
provider => git,
|
provider => git,
|
||||||
revision => $commit,
|
source => 'https://github.com/phacility/phabricator.git',
|
||||||
source => "https://github.com/phacility/phabricator.git",
|
|
||||||
require => [
|
require => [
|
||||||
File[$instance_dir],
|
File[$instance_dir],
|
||||||
Package['git'],
|
Package['git'],
|
||||||
|
@ -93,8 +92,7 @@ class phabricator (
|
||||||
vcsrepo { "${instance_dir}/arcanist":
|
vcsrepo { "${instance_dir}/arcanist":
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
provider => git,
|
provider => git,
|
||||||
revision => $commit,
|
source => 'https://github.com/phacility/arcanist.git',
|
||||||
source => "https://github.com/phacility/arcanist.git",
|
|
||||||
require => [
|
require => [
|
||||||
File[$instance_dir],
|
File[$instance_dir],
|
||||||
Package['git'],
|
Package['git'],
|
||||||
|
@ -104,38 +102,37 @@ class phabricator (
|
||||||
vcsrepo { "${instance_dir}/libphutil":
|
vcsrepo { "${instance_dir}/libphutil":
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
provider => git,
|
provider => git,
|
||||||
revision => $commit,
|
source => 'https://github.com/phacility/libphutil.git',
|
||||||
source => "https://github.com/phacility/libphutil.git",
|
|
||||||
require => [
|
require => [
|
||||||
File[$instance_dir],
|
File[$instance_dir],
|
||||||
Package['git'],
|
Package['git'],
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "initial.db":
|
file { 'initial.db':
|
||||||
path => "${phab_dir}/initial.db",
|
|
||||||
source => "puppet:///modules/phabricator/initial.db",
|
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
path => "${phab_dir}/initial.db",
|
||||||
|
source => 'puppet:///modules/phabricator/initial.db',
|
||||||
}
|
}
|
||||||
|
|
||||||
file {'local.json':
|
file {'local.json':
|
||||||
path => "${instance_dir}/phabricator/conf/local/local.json",
|
|
||||||
content => template("phabricator/local.json.erb"),
|
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
path => "${instance_dir}/phabricator/conf/local/local.json",
|
||||||
|
content => template('phabricator/local.json.erb'),
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "load-initial-db":
|
exec { 'load-initial-db':
|
||||||
command => "mysql < ${phab_dir}/initial.db && ${instance_dir}/phabricator/bin/storage upgrade --force",
|
command => "/usr/bin/mysql < ${phab_dir}/initial.db && ${instance_dir}/phabricator/bin/storage upgrade --force",
|
||||||
unless => "${instance_dir}/phabricator/bin/storage status",
|
unless => "${instance_dir}/phabricator/bin/storage status",
|
||||||
subscribe => File["initial.db"],
|
subscribe => File['initial.db'],
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
require => [
|
require => [
|
||||||
Vcsrepo["$instance_dir/phabricator"],
|
Vcsrepo["${instance_dir}/phabricator"],
|
||||||
File["initial.db"],
|
File['initial.db'],
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "update-database":
|
exec { 'update-database':
|
||||||
command => "${instance_dir}/phabricator/bin/storage upgrade --force",
|
command => "${instance_dir}/phabricator/bin/storage upgrade --force",
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
subscribe => Vcsrepo["${instance_dir}/phabricator"],
|
subscribe => Vcsrepo["${instance_dir}/phabricator"],
|
||||||
|
@ -143,16 +140,20 @@ class phabricator (
|
||||||
}
|
}
|
||||||
|
|
||||||
include apache
|
include apache
|
||||||
|
include apache::ssl
|
||||||
|
include apache::php
|
||||||
|
|
||||||
a2mod { 'rewrite':
|
a2mod { 'rewrite':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
apache::vhost { $vhost_name:
|
apache::vhost { $vhost_name:
|
||||||
port => 443,
|
port => 443,
|
||||||
docroot => "${instance_dir}/phabricator/webroot",
|
docroot => "${instance_dir}/phabricator/webroot/",
|
||||||
priority => '50',
|
priority => '50',
|
||||||
template => "phabricator/vhost.erb",
|
template => 'phabricator/vhost.erb',
|
||||||
ssl => true,
|
ssl => true,
|
||||||
|
require => File[$instance_dir],
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerAdmin noc@openstack.org
|
ServerAdmin noc@openstack.org
|
||||||
ServerName <%= @vhost_name %>
|
ServerName <%= scope.lookupvar("phabricator::vhost_name") %>
|
||||||
|
|
||||||
DocumentRoot /var/www
|
DocumentRoot /var/www
|
||||||
<Directory />
|
<Directory />
|
||||||
|
@ -11,12 +11,12 @@
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
AllowOverride None
|
AllowOverride None
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
allow from all
|
Allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteCond %{SERVER_PORT} !^443$
|
RewriteCond %{SERVER_PORT} !^443$
|
||||||
RewriteRule ^/(.*)$ https://<%= @vhost_name %>/$1 [L,R]
|
RewriteRule ^/(.*)$ https://<%= scope.lookupvar("phabricator::vhost_name") %>/$1 [L,R]
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/phabricator-error.log
|
ErrorLog /var/log/apache2/phabricator-error.log
|
||||||
|
|
||||||
|
@ -30,14 +30,14 @@
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
<VirtualHost *:443>
|
<VirtualHost *:443>
|
||||||
ServerAdmin noc@openstack.org
|
ServerAdmin noc@openstack.org
|
||||||
ServerName <%= @vhost_name %>
|
ServerName <%= scope.lookupvar("phabricator::vhost_name") %>
|
||||||
|
|
||||||
SSLEngine on
|
SSLEngine on
|
||||||
SSLProtocol All -SSLv2 -SSLv3
|
SSLProtocol All -SSLv2 -SSLv3
|
||||||
SSLCertificateFile <%= @ssl_cert_file %>
|
SSLCertificateFile <%= scope.lookupvar("phabricator::ssl_cert_file") %>
|
||||||
SSLCertificateKeyFile <%= @ssl_key_file %>
|
SSLCertificateKeyFile <%= scope.lookupvar("phabricator::ssl_key_file") %>
|
||||||
<% if @ssl_chain_file != "" %>
|
<% if scope.lookupvar("phabricator::ssl_chain_file") != "" %>
|
||||||
SSLCertificateChainFile <%= @ssl_chain_file %>
|
SSLCertificateChainFile <%= scope.lookupvar("phabricator::ssl_chain_file") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
DocumentRoot <%= @docroot %>
|
DocumentRoot <%= @docroot %>
|
||||||
|
@ -49,7 +49,8 @@
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
AllowOverride None
|
AllowOverride None
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
allow from all
|
Allow from all
|
||||||
|
Require all granted
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
Loading…
Reference in New Issue