Add consoleauth option support
Change-Id: Ic77b0a4aa0715344ed32c74cc11c114a6232af73
This commit is contained in:
parent
c990ec28c3
commit
83c9e4b17b
26
manifests/consoleauth.pp
Normal file
26
manifests/consoleauth.pp
Normal file
@ -0,0 +1,26 @@
|
||||
# == Class: nova::consoleauth
|
||||
#
|
||||
# Configure the consoleauth options
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*token_ttl*]
|
||||
# (Optional) The lifetime of a console auth token (in seconds).
|
||||
# Defaults to $facts['os_service_default'].
|
||||
#
|
||||
# [*enforce_session_timeout*]
|
||||
# (Optional) Enable ot disable enforce session timeout for VM console.
|
||||
# Defaults to $facts['os_service_default'].
|
||||
#
|
||||
class nova::consoleauth (
|
||||
$token_ttl = $facts['os_service_default'],
|
||||
$enforce_session_timeout = $facts['os_service_default'],
|
||||
) {
|
||||
|
||||
include nova::deps
|
||||
|
||||
nova_config {
|
||||
'consoleauth/token_ttl': value => $token_ttl;
|
||||
'consoleauth/enforce_session_timeout': value => $enforce_session_timeout;
|
||||
}
|
||||
}
|
4
releasenotes/notes/consoleauth-81bf3f52259e2468.yaml
Normal file
4
releasenotes/notes/consoleauth-81bf3f52259e2468.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``nova::consoleauth`` class has been added.
|
39
spec/classes/nova_consoleauth_spec.rb
Normal file
39
spec/classes/nova_consoleauth_spec.rb
Normal file
@ -0,0 +1,39 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'nova::consoleauth' do
|
||||
|
||||
shared_examples 'nova::consoleauth' do
|
||||
context 'with defaults' do
|
||||
it 'configures consoleauth in nova.conf' do
|
||||
should contain_nova_config('consoleauth/token_ttl').with_value('<SERVICE DEFAULT>')
|
||||
should contain_nova_config('consoleauth/enforce_session_timeout').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with parameters' do
|
||||
let :params do
|
||||
{
|
||||
:token_ttl => 600,
|
||||
:enforce_session_timeout => false,
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures consoleauth in nova.conf' do
|
||||
should contain_nova_config('consoleauth/token_ttl').with_value(600)
|
||||
should contain_nova_config('consoleauth/enforce_session_timeout').with_value(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'nova::consoleauth'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user