Skip to content

Commit

Permalink
Merge pull request #93 from fcharlier/vnc_fixes
Browse files Browse the repository at this point in the history
Vnc fixes
  • Loading branch information
bodepd committed Apr 25, 2012
2 parents 1d777b4 + 1763e02 commit c946ae4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
3 changes: 2 additions & 1 deletion manifests/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$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':
Expand All @@ -18,6 +18,7 @@
nova_config {
'vnc_enabled': value => $vnc_enabled;
'vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
'novncproxy_base_url': value => $novncproxy_base_url;
}

}
2 changes: 2 additions & 0 deletions manifests/controller.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@

class { "nova::vncproxy": enabled => true }

class { "nova::consoleauth": enabled => true }

nova::manage::admin { $admin_user: }
nova::manage::project { $project_name:
owner => $admin_user,
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
$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'
Expand All @@ -63,12 +62,14 @@
$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
Expand Down
15 changes: 7 additions & 8 deletions manifests/vncproxy.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -28,7 +27,7 @@
require => Package['python-numpy']
}

if ($::osfamily == 'Debian') {
if ($::osfamily == 'Debian' and $::operatingsystem != 'Debian') {

require git

Expand Down Expand Up @@ -56,7 +55,7 @@
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
Expand Down
31 changes: 28 additions & 3 deletions spec/classes/nova_vnc_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@
: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'
Expand All @@ -28,6 +38,21 @@
# '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
Expand Down

0 comments on commit c946ae4

Please sign in to comment.