Add novnc console support

This change adds in support for the novnc console type in Nova.

* The change adds in a few new variables to the defaults which allow
  for the novnc console to be configued.
* A port entry was added to haproxy to support the console type.
* noVNC is being installed from source in the nova_console container.
  The git repo has been added to the openstack_other.yml repo-package file
  which allows for the repo to be cloned into the repo containers and then
  distributed out where needed from within the environment.

Closes-Bug: 1428833

Change-Id: I221557aad77bf266b4e2fae23007ffa210aa1f75
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2015-09-25 20:50:42 -05:00 committed by Jesse Pretorius
parent 25a6798416
commit 8b296911bb
7 changed files with 147 additions and 17 deletions

View File

@ -160,12 +160,25 @@ nova_cross_az_attach: True
## Nova spice
nova_spice_html5proxy_base_proto: http
nova_spice_html5proxy_base_port: 6082
nova_spice_html5proxy_base_uri: "{{ nova_spice_html5proxy_base_proto }}://{{ external_lb_vip_address}}:{{ nova_spice_html5proxy_base_port }}"
nova_spice_html5proxy_base_uri: "{{ nova_spice_html5proxy_base_proto }}://{{ external_lb_vip_address }}:{{ nova_spice_html5proxy_base_port }}"
nova_spice_html5proxy_base_url: "{{ nova_spice_html5proxy_base_uri }}/spice_auto.html"
nova_spice_console_keymap: en-us
nova_spice_console_agent_enabled: True
nova_spice_program_name: nova-spicehtml5proxy
## Nova novnc
nova_novncproxy_proto: http
nova_novncproxy_port: 6080
nova_novncproxy_base_uri: "{{ nova_novncproxy_proto }}://{{ external_lb_vip_address }}:{{ nova_novncproxy_port }}"
nova_novncproxy_base_url: "{{ nova_novncproxy_base_uri }}/vnc_auto.html"
nova_novncproxy_vncserver_proxyclient_address: "{{ ansible_ssh_host }}"
nova_novncproxy_vncserver_listen: "{{ ansible_ssh_host }}"
nova_novncproxy_agent_enabled: True
nova_novncproxy_program_name: nova-novncproxy
nova_novncproxy_git_repo: https://github.com/kanaka/novnc
nova_novncproxy_git_install_branch: master
nova_novncproxy_vnc_keymap: en-us
## Nova metadata
nova_metadata_proxy_enabled: True
nova_metadata_port: 8775
@ -198,7 +211,7 @@ nova_console_agent_enabled: True
nova_consoleauth_program_name: nova-consoleauth
nova_console_agent_enabled: True
nova_console_keymap: en-us
# Set the console type. Presently the only option is ["spice"].
# Set the console type. Presently the only options are ["spice", "novnc"].
nova_console_type: spice
## Nova global config
@ -301,6 +314,7 @@ nova_service_names:
- "{{ nova_compute_program_name }}"
- "{{ nova_spice_program_name }}"
- "{{ nova_consoleauth_program_name }}"
- "{{ nova_novncproxy_program_name }}"
# Common apt packages
nova_apt_packages:
@ -312,6 +326,17 @@ nova_apt_packages:
nova_spice_apt_packages:
- spice-html5
nova_novnc_apt_packages:
- libjs-jquery
- libjs-sphinxdoc
- libjs-underscore
- libjs-swfobject
- librabbitmq1
- libyaml-0-2
nova_novnc_pip_packages:
- websockify
nova_compute_kvm_apt_packages:
- bridge-utils
- genisoimage

View File

@ -15,12 +15,7 @@
- include: nova_pre_install.yml
- include: nova_install.yml
- include: nova_spice_console_install.yml
when: >
inventory_hostname in groups['nova_console'] and
nova_console_type == "spice"
- include: nova_console_install.yml
- include: nova_post_install.yml
- include: nova_upstart_init.yml

View File

@ -0,0 +1,28 @@
---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- include: nova_console_spice_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
tags:
- nova-spice-console
- include: nova_console_novnc_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"
tags:
- nova-novnc-console

View File

@ -0,0 +1,66 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Get package from git
git:
repo: "{{ nova_novncproxy_git_repo }}"
dest: "/usr/share/novnc"
clone: "yes"
update: "yes"
version: "{{ nova_novncproxy_git_install_branch }}"
register: git_clone
until: git_clone|success
retries: 5
delay: 2
tags:
- nova-novnc-git
- name: Update apt sources
apt:
update_cache: yes
cache_valid_time: 600
register: apt_update
until: apt_update|success
retries: 5
delay: 2
tags:
- nova-apt-packages
- nova-novnc-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: nova_novnc_apt_packages
tags:
- nova-apt-packages
- nova-novnc-apt-packages
- name: Install pip packages
pip:
name: "{{ item }}"
state: present
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- "{{ nova_novnc_pip_packages }}"
tags:
- nova-novnc-pip-packages

View File

@ -37,4 +37,3 @@
tags:
- nova-apt-packages
- nova-spice-apt-packages

View File

@ -97,9 +97,21 @@
system_user: "{{ nova_system_user_name }}"
system_group: "{{ nova_system_group_name }}"
service_home: "{{ nova_system_home_folder }}"
when: >
inventory_hostname in groups ['nova_console'] and
nova_console_type == "spice"
when:
- inventory_hostname in groups ['nova_console']
- nova_console_type == "spice"
# Upstart init script for novnc console.
- include: nova_upstart_common_init.yml
vars:
program_name: "{{ nova_novncproxy_program_name }}"
service_name: "{{ nova_service_name }}"
system_user: "{{ nova_system_user_name }}"
system_group: "{{ nova_system_group_name }}"
service_home: "{{ nova_system_home_folder }}"
when:
- inventory_hostname in groups ['nova_console']
- nova_console_type == "novnc"
- include: nova_upstart_common_init.yml
vars:

View File

@ -92,9 +92,6 @@ default_floating_pool = public
security_group_api = neutron
network_api_class = nova.network.neutronv2.api.API
# VNC disabled, see spice section
vnc_enabled = False
# Authentication
auth_strategy = keystone
@ -131,7 +128,7 @@ catalog_info = volumev2:cinderv2:internalURL
cross_az_attach = {{ nova_cross_az_attach }}
{% if nova_spice_html5proxy_base_url is defined and nova_console_type == "spice" %}
{% if nova_console_type == 'spice' %}
[spice]
agent_enabled = {{ nova_console_agent_enabled }}
enabled = {{ nova_console_agent_enabled }}
@ -140,8 +137,16 @@ keymap = {{ nova_console_keymap }}
html5proxy_base_url = {{ nova_spice_html5proxy_base_url }}
server_listen = {{ ansible_ssh_host }}
server_proxyclient_address = {{ ansible_ssh_host }}
{% endif %}
{% elif nova_console_type == 'novnc' %}
[vnc]
enabled = {{ nova_novncproxy_agent_enabled }}
keymap = {{ nova_novncproxy_vnc_keymap }}
novncproxy_base_url = {{ nova_novncproxy_base_url }}
vncserver_listen = {{ nova_novncproxy_vncserver_listen }}
vncserver_proxyclient_address = {{ nova_novncproxy_vncserver_proxyclient_address }}
{% endif %}
# Glance
[glance]