Skip to content

Commit

Permalink
Add new dynflow plugin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stbenjam committed Feb 15, 2016
1 parent 273fc1c commit 744c720
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions manifests/plugin/dynflow.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
#
# $listen_on:: Proxy feature listens on https, http, or both
#
# $database_path:: Path to the SQLite database file
#
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,
) inherits foreman_proxy::plugin::dynflow::params {

validate_bool($enabled)
validate_listen_on($listen_on)
validate_absolute_path($database_path)

foreman_proxy::plugin { 'dynflow':
} ->
Expand Down
1 change: 1 addition & 0 deletions manifests/plugin/dynflow/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
class foreman_proxy::plugin::dynflow::params {
$enabled = true
$listen_on = 'https'
$database_path = '/var/lib/foreman-proxy/dynflow/dynflow.sqlite'
}
15 changes: 7 additions & 8 deletions spec/classes/foreman_proxy__plugin__dynflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
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_dir}/foreman-proxy/settings.d/dynflow.yml", [
'---',
':enabled: https',
':database: /var/lib/foreman-proxy/dynflow/dynflow.sqlite',
])
end
end
end
1 change: 1 addition & 0 deletions templates/plugin/dynflow.yml.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
:enabled: <%= @module_enabled %>
:database: <%= scope.lookupvar('::foreman_proxy::plugin::dynflow::database_path') %>

0 comments on commit 744c720

Please sign in to comment.