Browse Source

Add default variable assignment for optional Variables

github_url
Markus Opolka 6 years ago
parent
commit
447b5e8c40
  1. 18
      manifests/init.pp
  2. 22
      spec/acceptance/nomanage_spec.rb

18
manifests/init.pp

@ -81,15 +81,15 @@ class limesurvey (
Boolean $manage_webserver,
Boolean $manage_php,
Optional[String] $dbhost,
Optional[String] $dbname,
Optional[String] $dbpassword,
Optional[String] $dbuser,
Optional[String] $sql_root_password,
Optional[String] $vhost_name,
Optional[String] $vhost_port,
Optional[String] $mpm_module,
Optional[Hash] $php_packages,
Optional[String] $dbuser = undef,
Optional[String] $sql_root_password = undef,
Optional[String] $vhost_name = undef,
Optional[String] $vhost_port = undef,
Optional[String] $mpm_module = undef,
Optional[Hash] $php_packages = undef,
Optional[String] $dbhost = undef,
Optional[String] $dbname = undef,
Optional[String] $dbpassword = undef,
String $database_class = 'limesurvey::database',
String $webserver_class = 'limesurvey::webserver',

22
spec/acceptance/nomanage_spec.rb

@ -0,0 +1,22 @@
require 'spec_helper_acceptance'
describe 'limesurvey' do
context 'apply without manage_' do
it 'should idempotently run' do
pp = <<-EOS
class { 'limesurvey':
www_user => 'www-data',
www_group => 'www-data',
manage_webserver => false,
manage_database => false,
manage_php => false,
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end
Loading…
Cancel
Save