diff --git a/playbooks/defaults/repo_packages/openstack_other.yml b/playbooks/defaults/repo_packages/openstack_other.yml index c2f33655fc..3e0e6a5d11 100644 --- a/playbooks/defaults/repo_packages/openstack_other.yml +++ b/playbooks/defaults/repo_packages/openstack_other.yml @@ -41,3 +41,8 @@ openstackclient_git_dest: "/opt/openstackclient_{{ openstackclient_git_install_b djangoopenstackauth_git_repo: https://github.com/openstack/django_openstack_auth djangoopenstackauth_git_install_branch: 829cbee14e200fd127ec4f0e0f4d743102d8e9d1 djangoopenstackauth_git_dest: "/opt/djangoopenstackauth_{{ djangoopenstackauth_git_install_branch | replace('/', '_') }}" + +# NOVNC from source +novncproxy_git_repo: https://github.com/kanaka/novnc +novncproxy_git_install_branch: a0e7ab43dca0ce11a713694ee4cf530bd3b17c5a +novncproxy_git_dest: "/opt/novnc_{{ novncproxy_git_install_branch | replace('/', '_') }}" diff --git a/playbooks/inventory/group_vars/hosts.yml b/playbooks/inventory/group_vars/hosts.yml index 382349f1e7..7b1bb04b7a 100644 --- a/playbooks/inventory/group_vars/hosts.yml +++ b/playbooks/inventory/group_vars/hosts.yml @@ -36,6 +36,7 @@ rsyslog_server_storage_directory: /var/log/log-storage ## OpenStack source options # URL for the frozen internal openstack repo. openstack_repo_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}" +openstack_repo_git_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}/openstackgit" ## LXC options diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 572599fb0b..da9a5ca973 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -111,13 +111,20 @@ tags: - nova-logs roles: - - { role: "os_nova", tags: [ "os-nova" ] } + - role: "os_nova" + nova_novncproxy_git_repo: "{{ openstack_repo_git_url }}/novnc" + nova_novncproxy_git_install_branch: "{{ novncproxy_git_install_branch }}" + nova_galera_address: "{{ internal_lb_vip_address }}" + tags: + - "os-nova" - role: "ceph_client" openstack_service_system_user: "{{ nova_system_user_name }}" tags: - "nova-ceph-client" - "ceph-client" - - { role: "openstack_openrc", tags: [ "openstack-openrc" ] } + - role: "openstack_openrc" + tags: + - "openstack-openrc" - role: "rsyslog_client" rsyslog_client_log_rotate_file: nova_log_rotate rsyslog_client_log_dir: "/var/log/nova" @@ -130,8 +137,9 @@ - "system-crontab-coordination" vars: galera_address: "{{ internal_lb_vip_address }}" - nova_galera_address: "{{ internal_lb_vip_address }}" ansible_hostname: "{{ container_name }}" ansible_ssh_host: "{{ container_address }}" is_metal: "{{ properties.is_metal|default(false) }}" glance_host: "{{ internal_lb_vip_address }}" + vars_files: + - defaults/repo_packages/openstack_other.yml diff --git a/playbooks/repo-build.yml b/playbooks/repo-build.yml index 6587aff682..0858b098dc 100644 --- a/playbooks/repo-build.yml +++ b/playbooks/repo-build.yml @@ -28,6 +28,7 @@ create-report \ --report-file {{ repo_service_home_folder }}/repo/reports/release-{{ openstack_release }}-report.json \ --git-install-repos {{ item['remote_packages'] }} \ + --git-repo-path "{{ repo_service_home_folder }}/repo/openstackgit" \ --packages {{ item['packages'] }} with_py_pkgs: ../ sudo: yes @@ -49,6 +50,7 @@ --build-output "{{ repo_build_output }}" \ --build-dir "{{ repo_build_dir }}" \ --build-requirements \ + --git-repo-path "{{ repo_service_home_folder }}/repo/openstackgit" \ --force-clean sudo: yes sudo_user: "{{ repo_service_user_name }}" @@ -68,6 +70,7 @@ --build-dir "{{ repo_build_dir }}" \ --build-branches \ --build-releases \ + --git-repo-path "{{ repo_service_home_folder }}/repo/openstackgit" \ --force-clean sudo: yes sudo_user: "{{ repo_service_user_name }}" @@ -84,6 +87,17 @@ sudo_user: "{{ repo_service_user_name }}" tags: - repo-html-indexes + + - name: Store all git source + shell: | + yaprt --quiet \ + store-repos \ + --report-file {{ repo_service_home_folder }}/repo/reports/release-{{ openstack_release }}-report.json \ + --git-repo-path "{{ repo_service_home_folder }}/repo/openstackgit" + sudo: yes + sudo_user: "{{ repo_service_user_name }}" + tags: + - repo-store-git-sources vars: repo_build_dir: "/tmp/openstack-builder" repo_build_output: "/tmp/openstack-wheel-output" diff --git a/playbooks/roles/os_nova/defaults/main.yml b/playbooks/roles/os_nova/defaults/main.yml index e2b1e7a3e7..562afb5394 100644 --- a/playbooks/roles/os_nova/defaults/main.yml +++ b/playbooks/roles/os_nova/defaults/main.yml @@ -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 diff --git a/playbooks/roles/os_nova/tasks/main.yml b/playbooks/roles/os_nova/tasks/main.yml index 39374d6f33..194f6b5ce3 100644 --- a/playbooks/roles/os_nova/tasks/main.yml +++ b/playbooks/roles/os_nova/tasks/main.yml @@ -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 diff --git a/playbooks/roles/os_nova/tasks/nova_console_install.yml b/playbooks/roles/os_nova/tasks/nova_console_install.yml new file mode 100644 index 0000000000..f8a763e24b --- /dev/null +++ b/playbooks/roles/os_nova/tasks/nova_console_install.yml @@ -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 diff --git a/playbooks/roles/os_nova/tasks/nova_console_novnc_install.yml b/playbooks/roles/os_nova/tasks/nova_console_novnc_install.yml new file mode 100644 index 0000000000..bdbf55cfe0 --- /dev/null +++ b/playbooks/roles/os_nova/tasks/nova_console_novnc_install.yml @@ -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 diff --git a/playbooks/roles/os_nova/tasks/nova_spice_console_install.yml b/playbooks/roles/os_nova/tasks/nova_console_spice_install.yml similarity index 99% rename from playbooks/roles/os_nova/tasks/nova_spice_console_install.yml rename to playbooks/roles/os_nova/tasks/nova_console_spice_install.yml index a810474f3c..c98dfae179 100644 --- a/playbooks/roles/os_nova/tasks/nova_spice_console_install.yml +++ b/playbooks/roles/os_nova/tasks/nova_console_spice_install.yml @@ -37,4 +37,3 @@ tags: - nova-apt-packages - nova-spice-apt-packages - diff --git a/playbooks/roles/os_nova/tasks/nova_upstart_init.yml b/playbooks/roles/os_nova/tasks/nova_upstart_init.yml index 5da7ae974e..03a194b8a3 100644 --- a/playbooks/roles/os_nova/tasks/nova_upstart_init.yml +++ b/playbooks/roles/os_nova/tasks/nova_upstart_init.yml @@ -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: diff --git a/playbooks/roles/os_nova/templates/nova.conf.j2 b/playbooks/roles/os_nova/templates/nova.conf.j2 index 205664b0a8..f47043becf 100644 --- a/playbooks/roles/os_nova/templates/nova.conf.j2 +++ b/playbooks/roles/os_nova/templates/nova.conf.j2 @@ -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] diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index f02f595d4c..30f11d4e3c 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -128,6 +128,15 @@ haproxy_service_configs: haproxy_timeout_client: 60m haproxy_timeout_server: 60m haproxy_balance_alg: source + - service: + haproxy_service_name: nova_console_novnc + haproxy_backend_nodes: "{{ groups['nova_console'] }}" + haproxy_ssl: "{% if haproxy_ssl | bool and nova_novncproxy_proto == 'https' %}true{% else %}false{% endif %}" + haproxy_port: 6080 + haproxy_balance_type: tcp + haproxy_timeout_client: 60m + haproxy_timeout_server: 60m + haproxy_balance_alg: source - service: haproxy_service_name: cinder_api haproxy_backend_nodes: "{{ groups['cinder_api'] }}"