Updated nvcproxy class to use packages
Previously, the vnc package was installing novnc from source b/c the packages were not working correctly on Ubuntu. This commit removes the code that was installing from source and adds code to ensure that the correct vncproxy package is installed correctly on Ubuntu Precise.
This commit is contained in:
parent
38aa6ce2be
commit
4905dce9a8
|
@ -45,6 +45,7 @@ class nova::params {
|
||||||
$doc_package_name = 'nova-doc'
|
$doc_package_name = 'nova-doc'
|
||||||
$libvirt_package_name = 'libvirt-bin'
|
$libvirt_package_name = 'libvirt-bin'
|
||||||
$network_package_name = 'nova-network'
|
$network_package_name = 'nova-network'
|
||||||
|
$vncproxy_package_name = 'novnc'
|
||||||
$numpy_package_name = 'python-numpy'
|
$numpy_package_name = 'python-numpy'
|
||||||
$objectstore_package_name = 'nova-objectstore'
|
$objectstore_package_name = 'nova-objectstore'
|
||||||
$scheduler_package_name = 'nova-scheduler'
|
$scheduler_package_name = 'nova-scheduler'
|
||||||
|
@ -57,29 +58,26 @@ class nova::params {
|
||||||
$consoleauth_service_name = 'nova-consoleauth'
|
$consoleauth_service_name = 'nova-consoleauth'
|
||||||
$libvirt_service_name = 'libvirt-bin'
|
$libvirt_service_name = 'libvirt-bin'
|
||||||
$network_service_name = 'nova-network'
|
$network_service_name = 'nova-network'
|
||||||
|
$vncproxy_service_name = 'novnc'
|
||||||
$objectstore_service_name = 'nova-objectstore'
|
$objectstore_service_name = 'nova-objectstore'
|
||||||
$scheduler_service_name = 'nova-scheduler'
|
$scheduler_service_name = 'nova-scheduler'
|
||||||
$volume_service_name = 'nova-volume'
|
$volume_service_name = 'nova-volume'
|
||||||
|
$tgt_service_name = 'tgt'
|
||||||
|
# debian specific nova config
|
||||||
|
$root_helper = 'sudo nova-rootwrap'
|
||||||
|
$lock_path = '/var/lock/nova'
|
||||||
case $::operatingsystem {
|
case $::operatingsystem {
|
||||||
'Debian': {
|
'Debian': {
|
||||||
$consoleauth_package_name = 'nova-console'
|
$consoleauth_package_name = 'nova-console'
|
||||||
$vncproxy_package_name = 'novnc'
|
|
||||||
$vncproxy_service_name = 'novnc'
|
|
||||||
# Use default provider on Debian
|
# Use default provider on Debian
|
||||||
$special_service_provider = undef
|
$special_service_provider = undef
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
$consoleauth_package_name = 'nova-consoleauth'
|
$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
|
# some of the services need to be started form the special upstart provider
|
||||||
$special_service_provider = 'upstart'
|
$special_service_provider = 'upstart'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tgt_service_name = 'tgt'
|
|
||||||
# debian specific nova config
|
|
||||||
$root_helper = 'sudo nova-rootwrap'
|
|
||||||
$lock_path = '/var/lock/nova'
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
|
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
|
||||||
|
|
|
@ -27,46 +27,4 @@ class nova::vncproxy(
|
||||||
require => Package['python-numpy']
|
require => Package['python-numpy']
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($::osfamily == 'Debian' and $::operatingsystem != 'Debian') {
|
|
||||||
|
|
||||||
require git
|
|
||||||
|
|
||||||
package{ "noVNC":
|
|
||||||
ensure => purged,
|
|
||||||
}
|
|
||||||
file { '/etc/init.d/nova-novncproxy':
|
|
||||||
ensure => present,
|
|
||||||
source => 'puppet:///modules/nova/nova-novncproxy.init',
|
|
||||||
mode => 0750,
|
|
||||||
}
|
|
||||||
# this temporary upstart script needs to be removed
|
|
||||||
file { '/etc/init/nova-novncproxy.conf':
|
|
||||||
ensure => present,
|
|
||||||
content =>
|
|
||||||
'
|
|
||||||
description "nova noVNC Proxy server"
|
|
||||||
author "Etienne Pelletier <epelletier@morphlabs.com>"
|
|
||||||
|
|
||||||
start on (local-filesystems and net-device-up IFACE!=lo)
|
|
||||||
stop on runlevel [016]
|
|
||||||
|
|
||||||
respawn
|
|
||||||
|
|
||||||
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
|
|
||||||
vcsrepo { '/var/lib/nova/noVNC':
|
|
||||||
ensure => latest,
|
|
||||||
provider => git,
|
|
||||||
source => 'https://github.com/cloudbuilders/noVNC.git',
|
|
||||||
revision => 'HEAD',
|
|
||||||
require => Package['nova-api'],
|
|
||||||
before => Nova::Generic_service['vncproxy'],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ describe 'nova::vncproxy' do
|
||||||
'include nova'
|
'include nova'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{:enabled => true}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'on debian platforms' do
|
describe 'on debian platforms' do
|
||||||
let :facts do
|
let :facts do
|
||||||
{ :osfamily => 'Debian' }
|
{ :osfamily => 'Debian' }
|
||||||
|
@ -19,40 +23,14 @@ describe 'nova::vncproxy' do
|
||||||
it { should contain_nova_config('novncproxy_host').with(:value => '0.0.0.0') }
|
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_nova_config('novncproxy_port').with(:value => '6080') }
|
||||||
|
|
||||||
it { should contain_package('noVNC').with_ensure('purged') }
|
it { should contain_package('nova-vncproxy').with(
|
||||||
it { should contain_class('git') }
|
:name => 'novnc',
|
||||||
it { should contain_vcsrepo('/var/lib/nova/noVNC').with(
|
:ensure => 'present'
|
||||||
: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
|
it { should contain_service('nova-vncproxy').with(
|
||||||
# let :pre_condition do
|
:name => 'novnc',
|
||||||
# 'include nova::api'
|
:ensure => 'running'
|
||||||
# end
|
)}
|
||||||
# it { should contain_package('nova-vncproxy').with(
|
|
||||||
# 'ensure' => 'present',
|
|
||||||
# '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
|
end
|
||||||
|
|
||||||
describe 'on Redhatish platforms' do
|
describe 'on Redhatish platforms' do
|
||||||
|
|
Loading…
Reference in New Issue