Skip to content

Commit

Permalink
Merge pull request #337 from wyardley/fix_requires_2
Browse files Browse the repository at this point in the history
Fix tests for file resources in defined type (partially reverts #336)
  • Loading branch information
bastelfreak authored Sep 17, 2017
2 parents 99df53a + b9c2bd1 commit 8baf2c7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions manifests/config/resource_source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
section => '',
setting => "resources.source.${number}.type",
value => $source_type,
require => File[$properties_file],
}

case downcase($source_type) {
Expand All @@ -154,6 +155,7 @@
section => '',
setting => "resources.source.${number}.config.requireFileExists",
value => bool2str(true),
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.includeServerNode":
Expand All @@ -162,6 +164,7 @@
section => '',
setting => "resources.source.${number}.config.includeServerNode",
value => bool2str($include_server_node),
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.generateFileAutomatically":
Expand All @@ -170,6 +173,7 @@
section => '',
setting => "resources.source.${number}.config.generateFileAutomatically",
value => bool2str(true),
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.format":
Expand All @@ -178,6 +182,7 @@
section => '',
setting => "resources.source.${number}.config.format",
value => $resource_format,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.file":
Expand All @@ -186,6 +191,7 @@
section => '',
setting => "resources.source.${number}.config.file",
value => $file,
require => File[$properties_file],
}
}
'url': {
Expand All @@ -199,6 +205,7 @@
section => '',
setting => "resources.source.${number}.config.url",
value => $url,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.timeout":
Expand All @@ -207,6 +214,7 @@
section => '',
setting => "resources.source.${number}.config.timeout",
value => $url_timeout,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.cache":
Expand All @@ -215,6 +223,7 @@
section => '',
setting => "resources.source.${number}.config.cache",
value => bool2str($url_cache),
require => File[$properties_file],
}
}
'directory': {
Expand All @@ -233,6 +242,7 @@
section => '',
setting => "resources.source.${number}.config.directory",
value => $directory,
require => File[$properties_file],
}
}
'script': {
Expand All @@ -248,6 +258,7 @@
section => '',
setting => "resources.source.${number}.config.file",
value => $script_file,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.args":
Expand All @@ -256,6 +267,7 @@
section => '',
setting => "resources.source.${number}.config.args",
value => $script_args,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.format":
Expand All @@ -264,6 +276,7 @@
section => '',
setting => "resources.source.${number}.config.format",
value => $resource_format,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.interpreter":
Expand All @@ -272,6 +285,7 @@
section => '',
setting => "resources.source.${number}.config.interpreter",
value => $script_interpreter,
require => File[$properties_file],
}

ini_setting { "${name}::resources.source.${number}.config.argsQuoted":
Expand All @@ -280,6 +294,7 @@
section => '',
setting => "resources.source.${number}.config.argsQuoted",
value => bool2str($script_args_quoted),
require => File[$properties_file],
}
}
'aws-ec2': {
Expand All @@ -289,20 +304,23 @@
section => '',
setting => "resources.source.${number}.config.mappingParams",
value => $mapping_params,
require => File[$properties_file],
}
ini_setting { "${name}::resources.source.${number}.config.useDefaultMapping":
ensure => present,
path => $properties_file,
section => '',
setting => "resources.source.${number}.config.useDefaultMapping",
value => bool2str($use_default_mapping),
require => File[$properties_file],
}
ini_setting { "${name}::resources.source.${number}.config.runningOnly":
ensure => present,
path => $properties_file,
section => '',
setting => "resources.source.${number}.config.runningOnly",
value => bool2str($running_only),
require => File[$properties_file],
}
}
'puppet-enterprise': {
Expand All @@ -317,6 +335,7 @@
section => '',
setting => "resources.source.${number}.config.PROPERTY_MAPPING_FILE",
value => $puppet_enterprise_mapping_file,
require => File[$properties_file],
}
}
ini_setting { "${name}::resources.source.${number}.config.PROPERTY_PUPPETDB_HOST":
Expand All @@ -325,6 +344,7 @@
section => '',
setting => "resources.source.${number}.config.PROPERTY_PUPPETDB_HOST",
value => $puppet_enterprise_host,
require => File[$properties_file],
}
if ( $puppet_enterprise_metrics_interval != '') {
validate_integer($puppet_enterprise_metrics_interval)
Expand All @@ -334,6 +354,7 @@
section => '',
setting => "resources.source.${number}.config.PROPERTY_METRICS_INTERVAL",
value => $puppet_enterprise_metrics_interval,
require => File[$properties_file],
}
}
ini_setting { "${name}::resources.source.${number}.config.PROPERTY_PUPPETDB_PORT":
Expand All @@ -342,6 +363,7 @@
section => '',
setting => "resources.source.${number}.config.PROPERTY_PUPPETDB_PORT",
value => $puppet_enterprise_port,
require => File[$properties_file],
}
if ( $puppet_enterprise_ssl_dir != '') {
validate_absolute_path($puppet_enterprise_ssl_dir)
Expand All @@ -351,6 +373,7 @@
section => '',
setting => "resources.source.${number}.config.PROPERTY_PUPPETDB_SSL_DIR",
value => $puppet_enterprise_ssl_dir,
require => File[$properties_file],
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions spec/defines/config/resource_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
facts
end

let :pre_condition do
[
'include rundeck',
"rundeck::config::project { 'test': }"
]
end

describe "rundeck::config::resource_source definition with default parameters on #{os}" do
let(:title) { 'source one' }
let(:params) do
Expand Down

0 comments on commit 8baf2c7

Please sign in to comment.