Merge pull request #93 from fcharlier/vnc_fixes

Vnc fixes
This commit is contained in:
Dan Bode 2012-04-25 11:44:04 -07:00
commit 2501df04a1
5 changed files with 41 additions and 13 deletions

View File

@ -4,7 +4,7 @@ class nova::compute(
$enabled = false,
$vnc_enabled = true,
$vncserver_proxyclient_address = '127.0.0.1',
$novncproxy_base_url = 'http://127.0.0.1:6080/vnc_auto.htm'
$novncproxy_base_url = 'http://127.0.0.1:6080/vnc_auto.html'
) {
nova::generic_service { 'compute':
@ -18,6 +18,7 @@ class nova::compute(
nova_config {
'vnc_enabled': value => $vnc_enabled;
'vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
'novncproxy_base_url': value => $novncproxy_base_url;
}
}

View File

@ -109,6 +109,8 @@ class nova::controller(
class { "nova::vncproxy": enabled => true }
class { "nova::consoleauth": enabled => true }
nova::manage::admin { $admin_user: }
nova::manage::project { $project_name:
owner => $admin_user,

View File

@ -42,7 +42,6 @@ class nova::params {
$cert_package_name = 'nova-cert'
$common_package_name = 'nova-common'
$compute_package_name = 'nova-compute'
$consoleauth_package_name = 'nova-consoleauth'
$doc_package_name = 'nova-doc'
$libvirt_package_name = 'libvirt-bin'
$network_package_name = 'nova-network'
@ -63,12 +62,14 @@ class nova::params {
$volume_service_name = 'nova-volume'
case $::operatingsystem {
'Debian': {
$consoleauth_package_name = 'nova-console'
$vncproxy_package_name = 'novnc'
$vncproxy_service_name = 'novnc'
# Use default provider on Debian
$special_service_provider = undef
}
default: {
$consoleauth_package_name = 'nova-consoleauth'
$vncproxy_package_name = false
$vncproxy_service_name = 'nova-novncproxy'
# some of the services need to be started form the special upstart provider

View File

@ -1,20 +1,19 @@
class nova::vncproxy(
$enabled = false,
$host = '127.0.0.1',
$protocol = 'http',
$host = '0.0.0.0',
$port = '6080',
$path = '/vnc_auto.html'
) {
include nova::params
$novncproxy_base_url = "${protocol}://${host}:${port}${path}"
# TODO make this work on Fedora
# See http://nova.openstack.org/runnova/vncconsole.html for more details.
nova_config { 'novncproxy_base_url': value => $novncproxy_base_url }
nova_config {
'novncproxy_host': value => $host;
'novncproxy_port': value => $port;
}
package { 'python-numpy':
name => $::nova::params::numpy_package_name,
@ -28,7 +27,7 @@ class nova::vncproxy(
require => Package['python-numpy']
}
if ($::osfamily == 'Debian') {
if ($::osfamily == 'Debian' and $::operatingsystem != 'Debian') {
require git
@ -56,7 +55,7 @@ class nova::vncproxy(
exec su -s /bin/bash -c "exec /var/lib/nova/noVNC/utils/nova-novncproxy --flagfile=/etc/nova/nova.conf --web=/var/lib/nova/noVNC" nova
',
mode => 0750,
}
}
# TODO this is terrifying, it is grabbing master
# I should at least check out a branch

View File

@ -16,9 +16,19 @@ describe 'nova::vncproxy' do
:name => 'python-numpy'
)}
it { should contain_nova_config('novncproxy_base_url').with(
:value => 'http://127.0.0.1:6080/vnc_auto.html'
)}
it { should contain_nova_config('novncproxy_host').with(:value => '0.0.0.0') }
it { should contain_nova_config('novncproxy_port').with(:value => '6080') }
it { should contain_package('noVNC').with_ensure('purged') }
it { should contain_class('git') }
it { should contain_vcsrepo('/var/lib/nova/noVNC').with(
:ensure => 'latest',
:provider => 'git',
:source => 'https://github.com/cloudbuilders/noVNC.git',
:revision => 'HEAD',
:require => 'Package[nova-api]',
:before => 'Nova::Generic_service[vncproxy]'
) }
#describe 'when deployed on the API server' do
# let :pre_condition do
# 'include nova::api'
@ -28,6 +38,21 @@ describe 'nova::vncproxy' do
# 'before' => 'Exec[initial-db-sync]'
# )}
#end
describe 'and more precisely on Debian OS' do
let :facts do
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
end
it { should_not contain_class('git') }
it { should_not contain_vcsrepo('/var/lib/nova/noVNC') }
it { should_not contain_packate('noVNC') }
it { should contain_package('nova-vncproxy').with(
:name => 'novnc',
:ensure => 'present'
) }
end
end
describe 'on Redhatish platforms' do