diff --git a/manifests/compute.pp b/manifests/compute.pp index bab924d7..3ab01b26 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -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': @@ -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; } } diff --git a/manifests/controller.pp b/manifests/controller.pp index 34d3a530..dd6426c0 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -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, diff --git a/manifests/params.pp b/manifests/params.pp index 67adb47b..53e004bd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' @@ -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 diff --git a/manifests/vncproxy.pp b/manifests/vncproxy.pp index 179bfcbd..b9dd7572 100644 --- a/manifests/vncproxy.pp +++ b/manifests/vncproxy.pp @@ -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 @@ require => Package['python-numpy'] } - if ($::osfamily == 'Debian') { + if ($::osfamily == 'Debian' and $::operatingsystem != 'Debian') { require git @@ -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 diff --git a/spec/classes/nova_vnc_proxy_spec.rb b/spec/classes/nova_vnc_proxy_spec.rb index 1e7b3126..24d36c59 100644 --- a/spec/classes/nova_vnc_proxy_spec.rb +++ b/spec/classes/nova_vnc_proxy_spec.rb @@ -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' @@ -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