e1d2ece785
We recently introduced a change that allowed operators to pass novnc TLS cipher parameters to puppet-nova: https://review.opendev.org/#/c/723920/10 Unfortunately, the default values for NovaVNCProxySSLCiphers and NovaVNCProxySSLMinimumVersion conflict with puppet-nova and causes TLS-e deployments to fail with the following error during the overcloud deployment: /var/log/containers/nova/nova-novncproxy.log:2020-08-03 04:45:41.120 8 ERROR nova oslo_config.cfg.ConfigFileValueError: Value for option ssl_minimum_version from LocationInfo(location=<Locations.user: (4, True)>, detail='/etc/nova/nova.conf') is not valid: Valid values are [default, tlsv1_1, tlsv1_2, tlsv1_3], but found '' This is because the values don't match what puppet-nova is expecting and it causes the containers to fail. This commit attempts to add some resonable defaults in THT that align more closely with the puppet-nova defaults. It also only sets the ciphers if they're set by the end user. Change-Id: I2663bc9154846cc4642c3a030be0c57df4f25e1b
359 lines
14 KiB
YAML
359 lines
14 KiB
YAML
heat_template_version: rocky
|
|
|
|
description: >
|
|
OpenStack containerized Nova Vncproxy service
|
|
|
|
parameters:
|
|
ContainerNovaVncProxyImage:
|
|
description: image
|
|
type: string
|
|
ContainerNovaConfigImage:
|
|
description: The container image to use for the nova config_volume
|
|
type: string
|
|
NovaVncproxyLoggingSource:
|
|
type: json
|
|
default:
|
|
tag: openstack.nova.vncproxy
|
|
file: /var/log/containers/nova/nova-novncproxy.log
|
|
EndpointMap:
|
|
default: {}
|
|
description: Mapping of service endpoint -> protocol. Typically set
|
|
via parameter_defaults in the resource registry.
|
|
type: json
|
|
ServiceData:
|
|
default: {}
|
|
description: Dictionary packing service data
|
|
type: json
|
|
ServiceNetMap:
|
|
default: {}
|
|
description: Mapping of service_name -> network name. Typically set
|
|
via parameter_defaults in the resource registry. This
|
|
mapping overrides those in ServiceNetMapDefaults.
|
|
type: json
|
|
DefaultPasswords:
|
|
default: {}
|
|
type: json
|
|
RoleName:
|
|
default: ''
|
|
description: Role name on which the service is applied
|
|
type: string
|
|
RoleParameters:
|
|
default: {}
|
|
description: Parameters specific to the role
|
|
type: json
|
|
EnableInternalTLS:
|
|
type: boolean
|
|
default: false
|
|
UseTLSTransportForVnc:
|
|
type: boolean
|
|
default: true
|
|
description: If set to true and if EnableInternalTLS is enabled, it will
|
|
enable TLS transaport for libvirt VNC and configure the
|
|
relevant keys for libvirt.
|
|
InternalTLSVncProxyCAFile:
|
|
default: '/etc/pki/CA/certs/vnc.crt'
|
|
type: string
|
|
description: Specifies the CA cert to use for VNC TLS.
|
|
LibvirtVncCACert:
|
|
type: string
|
|
default: ''
|
|
description: This specifies the CA certificate to use for VNC TLS.
|
|
This file will be symlinked to the default CA path,
|
|
which is /etc/pki/libvirt-vnc/ca-cert.pem.
|
|
This parameter should be used if the default (which comes from
|
|
the InternalTLSVncProxyCAFile parameter) is not desired. The current
|
|
default reflects TripleO's default CA, which is FreeIPA.
|
|
It will only be used if internal TLS is enabled.
|
|
NovaVNCProxySSLCiphers:
|
|
type: string
|
|
default: ''
|
|
description: OpenSSL cipher preference string that specifies what ciphers
|
|
to allow for TLS connections from clients. See the man page
|
|
for the OpenSSL 'ciphers' command for details of the cipher
|
|
preference string format and allowed values.
|
|
NovaVNCProxySSLMinimumVersion:
|
|
type: string
|
|
default: 'default'
|
|
description: Minimum allowed SSL/TLS protocol version. Valid values are
|
|
'default', 'tlsv1_1', 'tlsv1_2', and 'tlsv1_3'. A value of
|
|
'default' will use the underlying system OpenSSL defaults.
|
|
constraints:
|
|
- allowed_values: ['default', 'tlsv1_1', 'tlsv1_2', 'tlsv1_3']
|
|
StackUpdateType:
|
|
type: string
|
|
description: >
|
|
Type of update, to differentiate between UPGRADE and UPDATE cases
|
|
when StackAction is UPDATE (both are the same stack action).
|
|
constraints:
|
|
- allowed_values: ['', 'UPGRADE']
|
|
default: ''
|
|
|
|
|
|
conditions:
|
|
|
|
use_tls_for_vnc:
|
|
and:
|
|
- equals:
|
|
- {get_param: EnableInternalTLS}
|
|
- true
|
|
- equals:
|
|
- {get_param: UseTLSTransportForVnc}
|
|
- true
|
|
|
|
libvirt_vnc_specific_ca_unset:
|
|
equals:
|
|
- {get_param: LibvirtVncCACert}
|
|
- ''
|
|
|
|
proxy_ssl_ciphers_unset:
|
|
equals:
|
|
- {get_param: NovaVNCProxySSLCiphers}
|
|
- ''
|
|
|
|
allow_noauth:
|
|
# Allow noauth VNC connections during P->Q upgrade. Remove in Rocky.
|
|
equals: [{get_param: StackUpdateType}, 'UPGRADE']
|
|
|
|
resources:
|
|
|
|
ContainersCommon:
|
|
type: ../containers-common.yaml
|
|
|
|
MySQLClient:
|
|
type: ../../deployment/database/mysql-client.yaml
|
|
|
|
NovaLogging:
|
|
type: OS::TripleO::Services::Logging::NovaCommon
|
|
properties:
|
|
ContainerNovaImage: {get_param: ContainerNovaVncProxyImage}
|
|
NovaServiceName: 'vncproxy'
|
|
|
|
NovaBase:
|
|
type: ./nova-base-puppet.yaml
|
|
properties:
|
|
ServiceData: {get_param: ServiceData}
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
|
DefaultPasswords: {get_param: DefaultPasswords}
|
|
EndpointMap: {get_param: EndpointMap}
|
|
RoleName: {get_param: RoleName}
|
|
RoleParameters: {get_param: RoleParameters}
|
|
|
|
outputs:
|
|
role_data:
|
|
description: Role data for the Nova Vncproxy service.
|
|
value:
|
|
service_name: nova_vnc_proxy
|
|
firewall_rules:
|
|
'137 nova_vnc_proxy':
|
|
dport:
|
|
- 6080
|
|
- 13080
|
|
config_settings:
|
|
map_merge:
|
|
- {get_attr: [NovaLogging, config_settings]}
|
|
- nova::vncproxy::enabled: true
|
|
nova::vncproxy::common::vncproxy_protocol: {get_param: [EndpointMap, NovaVNCProxyCellPublic, protocol]}
|
|
nova::vncproxy::common::vncproxy_host: {get_param: [EndpointMap, NovaVNCProxyCellPublic, host_nobrackets]}
|
|
nova::vncproxy::common::vncproxy_port: {get_param: [EndpointMap, NovaVNCProxyCellPublic, port]}
|
|
# NOTE: bind IP is found in hiera replacing the network name with the local node IP
|
|
# for the given network; replacement examples (eg. for internal_api):
|
|
# internal_api -> IP
|
|
# internal_api_uri -> [IP]
|
|
# internal_api_subnet - > IP/CIDR
|
|
nova::vncproxy::host:
|
|
str_replace:
|
|
template:
|
|
"%{hiera('$NETWORK')}"
|
|
params:
|
|
$NETWORK: {get_param: [ServiceNetMap, NovaApiNetwork]}
|
|
-
|
|
if:
|
|
- use_tls_for_vnc
|
|
-
|
|
nova::vncproxy::allow_vencrypt: true
|
|
nova::vncproxy::allow_noauth: {if: [allow_noauth, true, false]}
|
|
nova::vncproxy::vencrypt_key: /etc/pki/libvirt-vnc/client-key.pem
|
|
nova::vncproxy::vencrypt_cert: /etc/pki/libvirt-vnc/client-cert.pem
|
|
nova::vncproxy::vencrypt_ca: /etc/pki/libvirt-vnc/ca-cert.pem
|
|
nova::ssl_only: true
|
|
nova::console_ssl_ciphers:
|
|
if:
|
|
- proxy_ssl_ciphers_unset
|
|
- null
|
|
- get_param: NovaVNCProxySSLCiphers
|
|
nova::console_ssl_minimum_version: {get_param: NovaVNCProxySSLMinimumVersion}
|
|
nova::cert: /etc/pki/tls/certs/novnc_proxy.crt
|
|
nova::key: /etc/pki/tls/private/novnc_proxy.key
|
|
generate_service_certificates: true
|
|
tripleo::certmonger::ca::libvirt_vnc::origin_ca_pem:
|
|
if:
|
|
- libvirt_vnc_specific_ca_unset
|
|
- get_param: InternalTLSVncProxyCAFile
|
|
- get_param: LibvirtVncCACert
|
|
tripleo::certmonger::libvirt_vnc_dirs::certificate_dir: '/etc/pki/libvirt-vnc'
|
|
libvirt_vnc_certificates_specs:
|
|
libvirt-vnc-client-cert:
|
|
cacertfile:
|
|
if:
|
|
- libvirt_vnc_specific_ca_unset
|
|
- get_param: InternalTLSVncProxyCAFile
|
|
- null
|
|
service_certificate: '/etc/pki/libvirt-vnc/client-cert.pem'
|
|
service_key: '/etc/pki/libvirt-vnc/client-key.pem'
|
|
notify_service: '%{::nova::params::vncproxy_service_name}'
|
|
hostname:
|
|
str_replace:
|
|
template: "%{hiera('fqdn_NETWORK')}"
|
|
params:
|
|
NETWORK: {get_param: [ServiceNetMap, NovaVncProxyNetwork]}
|
|
principal:
|
|
str_replace:
|
|
template: "libvirt-vnc/%{hiera('fqdn_NETWORK')}"
|
|
params:
|
|
NETWORK: {get_param: [ServiceNetMap, NovaVncProxyNetwork]}
|
|
novnc_proxy_certificates_specs:
|
|
service_certificate: '/etc/pki/tls/certs/novnc_proxy.crt'
|
|
service_key: '/etc/pki/tls/private/novnc_proxy.key'
|
|
hostname:
|
|
str_replace:
|
|
template: "%{hiera('fqdn_NETWORK')}"
|
|
params:
|
|
NETWORK: {get_param: [ServiceNetMap, NovaApiNetwork]}
|
|
principal:
|
|
str_replace:
|
|
template: "novnc-proxy/%{hiera('fqdn_NETWORK')}"
|
|
params:
|
|
NETWORK: {get_param: [ServiceNetMap, NovaApiNetwork]}
|
|
- {}
|
|
service_config_settings:
|
|
rsyslog:
|
|
tripleo_logging_sources_nova_vnc_proxy:
|
|
- {get_param: NovaVncproxyLoggingSource}
|
|
# BEGIN DOCKER SETTINGS
|
|
puppet_config:
|
|
config_volume: nova
|
|
puppet_tags: nova_config
|
|
step_config:
|
|
list_join:
|
|
- "\n"
|
|
- - include tripleo::profile::base::nova::vncproxy
|
|
- {get_attr: [MySQLClient, role_data, step_config]}
|
|
config_image: {get_param: ContainerNovaConfigImage}
|
|
kolla_config:
|
|
/var/lib/kolla/config_files/nova_vnc_proxy.json:
|
|
command:
|
|
list_join:
|
|
- ' '
|
|
- - /usr/bin/nova-novncproxy --web /usr/share/novnc/
|
|
- get_attr: [NovaLogging, cmd_extra_args]
|
|
config_files:
|
|
- source: "/var/lib/kolla/config_files/src/*"
|
|
dest: "/"
|
|
merge: true
|
|
preserve_properties: true
|
|
- source: "/var/lib/kolla/config_files/src-tls/*"
|
|
dest: "/"
|
|
merge: true
|
|
preserve_properties: true
|
|
optional: true
|
|
permissions:
|
|
- path: /var/log/nova
|
|
owner: nova:nova
|
|
recurse: true
|
|
- path: /etc/pki/tls/private/novnc_proxy.key
|
|
owner: root:nova
|
|
docker_config:
|
|
step_4:
|
|
nova_vnc_proxy:
|
|
image: {get_param: ContainerNovaVncProxyImage}
|
|
net: host
|
|
privileged: false
|
|
restart: always
|
|
healthcheck:
|
|
test: /openstack/healthcheck
|
|
volumes:
|
|
list_concat:
|
|
- {get_attr: [ContainersCommon, volumes]}
|
|
- {get_attr: [NovaLogging, volumes]}
|
|
-
|
|
- /var/lib/kolla/config_files/nova_vnc_proxy.json:/var/lib/kolla/config_files/config.json:ro
|
|
- /var/lib/config-data/puppet-generated/nova:/var/lib/kolla/config_files/src:ro
|
|
-
|
|
if:
|
|
- use_tls_for_vnc
|
|
-
|
|
- str_replace:
|
|
template: "CACERT:/etc/pki/libvirt-vnc/ca-cert.pem:ro"
|
|
params:
|
|
CACERT:
|
|
if:
|
|
- libvirt_vnc_specific_ca_unset
|
|
- get_param: InternalTLSVncProxyCAFile
|
|
- get_param: LibvirtVncCACert
|
|
- /etc/pki/libvirt-vnc/client-cert.pem:/etc/pki/libvirt-vnc/client-cert.pem:ro
|
|
- /etc/pki/libvirt-vnc/client-key.pem:/etc/pki/libvirt-vnc/client-key.pem:ro
|
|
- /etc/pki/tls/certs/novnc_proxy.crt:/var/lib/kolla/config_files/src-tls/etc/pki/tls/certs/novnc_proxy.crt:ro
|
|
- /etc/pki/tls/private/novnc_proxy.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/novnc_proxy.key:ro
|
|
- null
|
|
environment:
|
|
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
|
metadata_settings:
|
|
if:
|
|
- use_tls_for_vnc
|
|
-
|
|
- service: libvirt-vnc
|
|
network: {get_param: [ServiceNetMap, NovaVncProxyNetwork]}
|
|
type: node
|
|
- service: novnc-proxy
|
|
network: {get_param: [ServiceNetMap, NovaApiNetwork]}
|
|
type: node
|
|
- null
|
|
deploy_steps_tasks:
|
|
- name: validate nova-vnc-proxy container state
|
|
podman_container_info:
|
|
name: nova_vnc_proxy
|
|
register: nova_vnc_proxy_infos
|
|
failed_when:
|
|
- nova_vnc_proxy_infos.containers.0.Healthcheck.Status is defined
|
|
- "'healthy' not in nova_vnc_proxy_infos.containers.0.Healthcheck.Status"
|
|
retries: 10
|
|
delay: 30
|
|
tags:
|
|
- opendev-validation
|
|
- opendev-validation-nova
|
|
when:
|
|
- container_cli == 'podman'
|
|
- not container_healthcheck_disabled
|
|
- step|int == 5
|
|
host_prep_tasks:
|
|
list_concat:
|
|
- {get_attr: [NovaLogging, host_prep_tasks]}
|
|
- - name: ensure qemu group is present on the host
|
|
group:
|
|
name: qemu
|
|
gid: 107
|
|
state: present
|
|
- name: ensure qemu user is present on the host
|
|
user:
|
|
name: qemu
|
|
uid: 107
|
|
group: qemu
|
|
state: present
|
|
shell: /sbin/nologin
|
|
comment: qemu user
|
|
external_upgrade_tasks:
|
|
- when:
|
|
- step|int == 1
|
|
tags:
|
|
- never
|
|
- system_upgrade_transfer_data
|
|
- system_upgrade_stop_services
|
|
block:
|
|
- name: Stop nova vnc proxy container
|
|
import_role:
|
|
name: tripleo_container_stop
|
|
vars:
|
|
tripleo_containers_to_stop:
|
|
- nova_vnc_proxy
|
|
tripleo_delegate_to: "{{ groups['nova_vnc_proxy'] | default([]) }}"
|