-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d3da00
commit 03d7ae1
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# = Foreman Proxy Shelhooks plugin | ||
# | ||
# This class installs the Shellhooks plugin | ||
# | ||
# === Parameters: | ||
# | ||
# $directory:: Absolute path to directory with executables | ||
# | ||
# === Advanced parameters: | ||
# | ||
# $enabled:: enables/disables the shellhooks plugin | ||
# | ||
# $listen_on:: proxy feature listens on http, https, or both | ||
# | ||
# $version:: plugin package version, it's passed to ensure parameter of package resource | ||
# can be set to specific version number, 'latest', 'present' etc. | ||
# | ||
class foreman_proxy::plugin::shellhooks ( | ||
Optional[String] $version = undef, | ||
Boolean $enabled = true, | ||
Stdlib::Absolutepath $directory = '/var/lib/foreman-proxy/shellhooks', | ||
Foreman_proxy::ListenOn $listen_on = 'https', | ||
) { | ||
foreman_proxy::plugin::module { 'shellhooks': | ||
enabled => $enabled, | ||
feature => 'shellhooks', | ||
listen_on => $listen_on, | ||
version => $version, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'spec_helper' | ||
|
||
describe 'foreman_proxy::plugin::shellhooks' do | ||
on_plugin_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
let(:pre_condition) { 'include foreman_proxy' } | ||
|
||
describe 'with default settings' do | ||
it { should contain_foreman_proxy__plugin__module('shellhooks') } | ||
it 'shellhooks.yml should contain the correct configuration' do | ||
verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/shellhooks.yml', [ | ||
'---', | ||
':enabled: https', | ||
':directory: /var/lib/foreman-proxy/shellhooks' | ||
]) | ||
end | ||
end | ||
|
||
describe 'with overwritten parameters' do | ||
let :params do | ||
{ :directory => '/opt/custom_shellhooks' } | ||
end | ||
|
||
it 'shellhooks.yml should contain the correct configuration' do | ||
verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/shellhooks.yml', [ | ||
'---', | ||
':enabled: https', | ||
':directory: /opt/custom_shellhooks', | ||
]) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# always enable HTTPS only | ||
:enabled: <%= @module_enabled %> | ||
# directory with executables | ||
:directory: <%= scope.lookupvar("foreman_proxy::plugin::shellhooks::directory") %> |