Revision 5791db19
Added by Stephen Benjamin over 8 years ago
manifests/plugin/dynflow.pp | ||
---|---|---|
#
|
||
# $listen_on:: Proxy feature listens on https, http, or both
|
||
#
|
||
# $database_path:: Path to the SQLite database file
|
||
#
|
||
# $console_auth:: Whether to enable trusted hosts and ssl for the dynflow console
|
||
# type:boolean
|
||
#
|
||
class foreman_proxy::plugin::dynflow (
|
||
$enabled = $::foreman_proxy::plugin::dynflow::params::enabled,
|
||
$listen_on = $::foreman_proxy::plugin::dynflow::params::listen_on,
|
||
$database_path = $::foreman_proxy::plugin::dynflow::params::database_path,
|
||
$console_auth = $::foreman_proxy::plugin::dynflow::params::console_auth,
|
||
) inherits foreman_proxy::plugin::dynflow::params {
|
||
|
||
validate_bool($enabled)
|
||
validate_bool($enabled, $console_auth)
|
||
validate_listen_on($listen_on)
|
||
validate_absolute_path($database_path)
|
||
|
||
foreman_proxy::plugin { 'dynflow':
|
||
} ->
|
manifests/plugin/dynflow/params.pp | ||
---|---|---|
class foreman_proxy::plugin::dynflow::params {
|
||
$enabled = true
|
||
$listen_on = 'https'
|
||
$database_path = '/var/lib/foreman-proxy/dynflow/dynflow.sqlite'
|
||
$console_auth = true
|
||
}
|
spec/classes/foreman_proxy__plugin__dynflow_spec.rb | ||
---|---|---|
end
|
||
|
||
it { should contain_foreman_proxy__plugin('dynflow') }
|
||
it 'should configure dynflow.yml' do
|
||
should contain_file('/etc/foreman-proxy/settings.d/dynflow.yml').
|
||
with({
|
||
:ensure => 'file',
|
||
:owner => 'root',
|
||
:mode => '0640',
|
||
:content => /:enabled: https/
|
||
})
|
||
|
||
it 'should generate correct dynflow.yml' do
|
||
verify_exact_contents(catalogue, "/etc/foreman-proxy/settings.d/dynflow.yml", [
|
||
'---',
|
||
':enabled: https',
|
||
':database: /var/lib/foreman-proxy/dynflow/dynflow.sqlite',
|
||
':console_auth: true',
|
||
])
|
||
end
|
||
end
|
||
end
|
templates/plugin/dynflow.yml.erb | ||
---|---|---|
---
|
||
:enabled: <%= @module_enabled %>
|
||
:database: <%= scope.lookupvar('::foreman_proxy::plugin::dynflow::database_path') %>
|
||
:console_auth: <%= scope.lookupvar('::foreman_proxy::plugin::dynflow::console_auth') %>
|
Also available in: Unified diff
Add new dynflow plugin settings
closes GH-219