Add zaqar::transport::websocket class
This class helps manage zaqar transport settings for websockets. Change-Id: Idf9589785431c32ac2678351ca326e8a0d4d57d5
This commit is contained in:
parent
e9b736c8eb
commit
623ed3789b
27
manifests/transport/websocket.pp
Normal file
27
manifests/transport/websocket.pp
Normal file
@ -0,0 +1,27 @@
|
||||
# == class: zaqar::transport::websocket
|
||||
#
|
||||
# [*bind*]
|
||||
# Address on which the self-hosting server will listen.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*port*]
|
||||
# Port on which the self-hosting server will listen.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*external_port*]
|
||||
# Port on which the service is provided to the user.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
class zaqar::transport::websocket(
|
||||
$bind = $::os_service_default,
|
||||
$port = $::os_service_default,
|
||||
$external_port = $::os_service_default,
|
||||
) {
|
||||
|
||||
zaqar_config {
|
||||
'drivers:transport:websocket/bind': value => $bind;
|
||||
'drivers:transport:websocket/port': value => $port;
|
||||
'drivers:transport:websocket/external-port': value => $external_port;
|
||||
}
|
||||
|
||||
}
|
25
spec/classes/zaqar_transport_websocket_spec.rb
Normal file
25
spec/classes/zaqar_transport_websocket_spec.rb
Normal file
@ -0,0 +1,25 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'zaqar::transport::websocket' do
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
describe 'with custom values' do
|
||||
let :params do
|
||||
{
|
||||
:bind => '1',
|
||||
:port => '2',
|
||||
:external_port => '3',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures custom values' do
|
||||
is_expected.to contain_zaqar_config('drivers:transport:websocket/bind').with_value('1')
|
||||
is_expected.to contain_zaqar_config('drivers:transport:websocket/port').with_value('2')
|
||||
is_expected.to contain_zaqar_config('drivers:transport:websocket/external-port').with_value('3')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user