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'
|
||||
$libvirt_package_name = 'libvirt-bin'
|
||||
$network_package_name = 'nova-network'
|
||||
$vncproxy_package_name = 'novnc'
|
||||
$numpy_package_name = 'python-numpy'
|
||||
$objectstore_package_name = 'nova-objectstore'
|
||||
$scheduler_package_name = 'nova-scheduler'
|
||||
|
@ -57,29 +58,26 @@ class nova::params {
|
|||
$consoleauth_service_name = 'nova-consoleauth'
|
||||
$libvirt_service_name = 'libvirt-bin'
|
||||
$network_service_name = 'nova-network'
|
||||
$vncproxy_service_name = 'novnc'
|
||||
$objectstore_service_name = 'nova-objectstore'
|
||||
$scheduler_service_name = 'nova-scheduler'
|
||||
$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 {
|
||||
'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
|
||||
$special_service_provider = 'upstart'
|
||||
}
|
||||
}
|
||||
$tgt_service_name = 'tgt'
|
||||
# debian specific nova config
|
||||
$root_helper = 'sudo nova-rootwrap'
|
||||
$lock_path = '/var/lock/nova'
|
||||
}
|
||||
default: {
|
||||
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']
|
||||
}
|
||||
|
||||
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'
|
||||
end
|
||||
|
||||
let :params do
|
||||
{:enabled => true}
|
||||
end
|
||||
|
||||
describe 'on debian platforms' do
|
||||
let :facts do
|
||||
{ :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_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]'
|
||||
it { should contain_package('nova-vncproxy').with(
|
||||
:name => 'novnc',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
#describe 'when deployed on the API server' do
|
||||
# let :pre_condition do
|
||||
# 'include nova::api'
|
||||
# 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
|
||||
it { should contain_service('nova-vncproxy').with(
|
||||
:name => 'novnc',
|
||||
:ensure => 'running'
|
||||
)}
|
||||
end
|
||||
|
||||
describe 'on Redhatish platforms' do
|
||||
|
|
Loading…
Reference in New Issue