35e69494bae05195c508868e5a4ecb430944c433
[apex-tripleo-heat-templates.git] / docker / services / nova-vnc-proxy.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Nova Vncproxy service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaVncProxyImage:
12     description: image
13     default: 'centos-binary-nova-novncproxy:latest'
14     type: string
15   DockerNovaConfigImage:
16     description: The container image to use for the nova config_volume
17     default: 'centos-binary-nova-base:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceNetMap:
25     default: {}
26     description: Mapping of service_name -> network name. Typically set
27                  via parameter_defaults in the resource registry.  This
28                  mapping overrides those in ServiceNetMapDefaults.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40     type: json
41
42 resources:
43
44   ContainersCommon:
45     type: ./containers-common.yaml
46
47   NovaVncProxyPuppetBase:
48     type: ../../puppet/services/nova-vnc-proxy.yaml
49     properties:
50       EndpointMap: {get_param: EndpointMap}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       RoleName: {get_param: RoleName}
54       RoleParameters: {get_param: RoleParameters}
55
56 outputs:
57   role_data:
58     description: Role data for the Nova Vncproxy service.
59     value:
60       service_name: {get_attr: [NovaVncProxyPuppetBase, role_data, service_name]}
61       config_settings: {get_attr: [NovaVncProxyPuppetBase, role_data, config_settings]}
62       step_config: &step_config
63         get_attr: [NovaVncProxyPuppetBase, role_data, step_config]
64       service_config_settings: {get_attr: [NovaVncProxyPuppetBase, role_data, service_config_settings]}
65       # BEGIN DOCKER SETTINGS
66       puppet_config:
67         config_volume: nova
68         puppet_tags: nova_config
69         step_config: *step_config
70         config_image:
71           list_join:
72           - '/'
73           - [ {get_param: DockerNamespace}, {get_param: DockerNovaConfigImage} ]
74       kolla_config:
75         /var/lib/kolla/config_files/nova_vnc_proxy.json:
76           command: /usr/bin/nova-novncproxy --web /usr/share/novnc/
77           config_files:
78             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82           permissions:
83             - path: /var/log/nova
84               owner: nova:nova
85               recurse: true
86       docker_config:
87         step_4:
88           nova_vnc_proxy:
89             image:
90               list_join:
91                 - '/'
92                 - [ {get_param: DockerNamespace}, {get_param: DockerNovaVncProxyImage} ]
93             net: host
94             privileged: false
95             restart: always
96             volumes:
97               list_concat:
98                 - {get_attr: [ContainersCommon, volumes]}
99                 -
100                   - /var/lib/kolla/config_files/nova_vnc_proxy.json:/var/lib/kolla/config_files/config.json:ro
101                   - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
102                   - /var/log/containers/nova:/var/log/nova
103             environment:
104               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
105       host_prep_tasks:
106         - name: create persistent logs directory
107           file:
108             path: /var/log/containers/nova
109             state: directory
110       upgrade_tasks:
111         - name: Stop and disable nova_vnc_proxy service
112           tags: step2
113           service: name=openstack-nova-novncproxy state=stopped enabled=no