Skip to content

Commit a24d0cb

Browse files
committed
Implement openbolt plugin support
1 parent 26333ee commit a24d0cb

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

manifests/plugin/openbolt.pp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# = Foreman Proxy OpenBolt plugin
2+
#
3+
# This class installs the OpenBolt plugin
4+
#
5+
# === Parameters:
6+
#
7+
# $environment_path:: Path to the environment with all modules
8+
#
9+
# $worker:: Define the amount of possible workers
10+
#
11+
# $concurreny:: Define the limit of concurrent connections for executed tasks
12+
#
13+
# $connect_timeout:: Timeout in seconds for connecting to remote systems
14+
#
15+
# === Advanced parameters:
16+
#
17+
# $enabled:: enables/disables the HDM plugin
18+
#
19+
# $listen_on:: proxy feature listens on http, https, or both
20+
#
21+
# $version:: plugin package version, it's passed to ensure parameter of package resource
22+
# can be set to specific version number, 'latest', 'present' etc.
23+
#
24+
class foreman_proxy::plugin::openbolt (
25+
Optional[String[1]] $version = undef,
26+
Boolean $enabled = true,
27+
Foreman_proxy::ListenOn $listen_on = 'https',
28+
Stdlib::Absolutepath $environment_path = '/etc/puppetlabs/code/environments/production',
29+
Integer[0] $workers = 20,
30+
Integer[0] $concurrency = 100,
31+
Integer[1] $connect_timeout = 30,
32+
Stdlib::Absolutepath $log_dir = '/var/log/foreman-proxy/openbolt',
33+
) {
34+
foreman_proxy::plugin::module { 'openbolt':
35+
template_path => 'foreman_proxy/plugin/openbolt.yml.erb',
36+
enabled => $enabled,
37+
feature => 'Openbolt',
38+
listen_on => $listen_on,
39+
version => $version,
40+
}
41+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'spec_helper'
2+
3+
describe 'foreman_proxy::plugin::openbolt' do
4+
on_plugin_os.each do |os, os_facts|
5+
context "on #{os}" do
6+
let(:facts) { os_facts }
7+
let(:pre_condition) { 'include foreman_proxy' }
8+
let(:etc_dir) { '/etc' }
9+
10+
describe 'with default settings' do
11+
it { is_expected.to compile.with_all_deps }
12+
it { is_expected.to contain_foreman_proxy__plugin('openbolt') }
13+
end
14+
end
15+
end
16+
end

templates/plugin/openbolt.yml.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
---
3+
:enabled: <%= @module_enabled %>
4+
:environment_path: <%= scope.lookupvar("foreman_proxy::plugin::openbolt::environment_path") %>
5+
:workers: <%= scope.lookupvar("foreman_proxy::plugin::openbolt::workers") %>
6+
:concurrency: <%= scope.lookupvar("foreman_proxy::plugin::openbolt::concurrency") %>
7+
:connect_timeout: <%= scope.lookupvar("foreman_proxy::plugin::openbolt::connect_timeout") %>
8+
:log_dir: <%= scope.lookupvar("foreman_proxy::plugin::openbolt::log_dir") %>

0 commit comments

Comments
 (0)