diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dade81e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Gemfile.lock +.bundled_gems/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..96912da --- /dev/null +++ b/Gemfile @@ -0,0 +1,30 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'puppetlabs_spec_helper', :require => false + + gem 'metadata-json-lint' + # This is nice and all, but let's not worry about it until we've actually + # got puppet 4.x sorted + # gem 'puppet-lint-param-docs' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-absolute_template_path' + gem 'puppet-lint-trailing_newline-check' + + # Puppet 4.x related lint checks + gem 'puppet-lint-unquoted_string-check' + gem 'puppet-lint-empty_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-undef_in_function-check' + + if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false + else + gem 'puppet', '~> 3.0', :require => false + end + +end + +# vim:ft=ruby diff --git a/manifests/init.pp b/manifests/init.pp index 167cfd3..3e50b85 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,10 +11,10 @@ class phabricator ( $mysql_user_password, $ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem", $ssl_key_file = "/etc/ssl/private/${::fqdn}.key", - $ssl_chain_file = '', - $ssl_cert_file_contents = '', # If left empty puppet will not create file. - $ssl_key_file_contents = '', # If left empty puppet will not create file. - $ssl_chain_file_contents = '' # If left empty puppet will not create file. + $ssl_chain_file = undef, + $ssl_cert_file_contents = undef, # If left empty puppet will not create file. + $ssl_key_file_contents = undef, # If left empty puppet will not create file. + $ssl_chain_file_contents = undef # If left empty puppet will not create file. ) { $instances_dir = "${phab_dir}/instances" @@ -50,7 +50,7 @@ class phabricator ( ensure => directory, } - if $ssl_cert_file_contents != '' { + if $ssl_cert_file_contents != undef { file { $ssl_cert_file: owner => 'root', group => 'root', @@ -60,7 +60,7 @@ class phabricator ( } } - if $ssl_key_file_contents != '' { + if $ssl_key_file_contents != undef { file { $ssl_key_file: owner => 'root', group => 'ssl-cert', @@ -70,7 +70,7 @@ class phabricator ( } } - if $ssl_chain_file_contents != '' { + if $ssl_chain_file_contents != undef { file { $ssl_chain_file: owner => 'root', group => 'root', @@ -131,9 +131,9 @@ class phabricator ( } file { '/etc/php5/apache2/conf.d/20-phabricator.ini': - ensure => 'link', - target => '/etc/php5/mods-available/phabricator.ini', - notify => Service['httpd'], + ensure => 'link', + target => '/etc/php5/mods-available/phabricator.ini', + notify => Service['httpd'], } exec { 'load-initial-db': diff --git a/manifests/mysql.pp b/manifests/mysql.pp index 6ad8259..3533d1e 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -22,10 +22,10 @@ class phabricator::mysql( class { '::mysql::server': config_hash => { - 'root_password' => $mysql_root_password, - 'default_engine' => 'InnoDB', - 'bind_address' => $mysql_bind_address, - 'port' => $mysql_port, + 'root_password' => $mysql_root_password, + 'default_engine' => 'InnoDB', + 'bind_address' => $mysql_bind_address, + 'port' => $mysql_port, } } diff --git a/templates/vhost.erb b/templates/vhost.erb index 933f817..de27939 100644 --- a/templates/vhost.erb +++ b/templates/vhost.erb @@ -36,7 +36,9 @@ SSLProtocol All -SSLv2 -SSLv3 SSLCertificateFile <%= scope.lookupvar("phabricator::ssl_cert_file") %> SSLCertificateKeyFile <%= scope.lookupvar("phabricator::ssl_key_file") %> - <% if scope.lookupvar("phabricator::ssl_chain_file") != "" %> + <%# scope.lookupvar returns nil for an undefined variable in puppet 4 -%> + <%# scope.lookupvar returns :undef for an undefined variable in puppet 3 -%> + <% unless ['', nil, :undef].include?(scope.lookupvar("phabricator::ssl_chain_file")) %> SSLCertificateChainFile <%= scope.lookupvar("phabricator::ssl_chain_file") %> <% end %>