02f7febe34575a027ab46e4d9addc732ff1bfe23
[apex-tripleo-heat-templates.git] / docker / services / heat-engine.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Heat Engine service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerHeatEngineImage:
12     description: image
13     default: 'centos-binary-heat-engine:latest'
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     default: {}
35     description: Parameters specific to the role
36
37
38 resources:
39
40   ContainersCommon:
41     type: ./containers-common.yaml
42
43   HeatBase:
44     type: ../../puppet/services/heat-engine.yaml
45     properties:
46       EndpointMap: {get_param: EndpointMap}
47       ServiceNetMap: {get_param: ServiceNetMap}
48       DefaultPasswords: {get_param: DefaultPasswords}
49       RoleName: {get_param: RoleName}
50       RoleParameters: {get_param: RoleParameters}
51
52 outputs:
53   role_data:
54     description: Role data for the Heat Engine role.
55     value:
56       service_name: {get_attr: [HeatBase, role_data, service_name]}
57       config_settings:
58         map_merge:
59           - get_attr: [HeatBase, role_data, config_settings]
60           - apache::default_vhost: false
61       step_config: &step_config
62         get_attr: [HeatBase, role_data, step_config]
63       service_config_settings: {get_attr: [HeatBase, role_data, service_config_settings]}
64       # BEGIN DOCKER SETTINGS
65       puppet_config:
66         config_volume: heat
67         puppet_tags: heat_config,file,concat,file_line
68         step_config: *step_config
69         config_image: &heat_engine_image
70           list_join:
71             - '/'
72             - [ {get_param: DockerNamespace}, {get_param: DockerHeatEngineImage} ]
73       kolla_config:
74         /var/lib/kolla/config_files/heat_engine.json:
75           command: /usr/bin/heat-engine --config-file /usr/share/heat/heat-dist.conf --config-file /etc/heat/heat.conf
76           permissions:
77             - path: /var/log/heat
78               owner: heat:heat
79               recurse: true
80       docker_config:
81         # db sync runs before permissions set by kolla_config
82         step_3:
83           heat_init_log:
84             start_order: 0
85             image: *heat_engine_image
86             user: root
87             volumes:
88               - /var/log/containers/heat:/var/log/heat
89             command: ['/bin/bash', '-c', 'chown -R heat:heat /var/log/heat']
90           heat_engine_db_sync:
91             start_order: 1
92             image: *heat_engine_image
93             net: host
94             privileged: false
95             detach: false
96             volumes:
97               list_concat:
98                 - {get_attr: [ContainersCommon, volumes]}
99                 -
100                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
101                   - /var/log/containers/heat:/var/log/heat
102             command: ['heat-manage', 'db_sync']
103         step_4:
104           heat_engine:
105             image: *heat_engine_image
106             net: host
107             privileged: false
108             restart: always
109             volumes:
110               list_concat:
111                 - {get_attr: [ContainersCommon, volumes]}
112                 -
113                   - /var/lib/kolla/config_files/heat_engine.json:/var/lib/kolla/config_files/config.json:ro
114                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
115                   - /var/log/containers/heat:/var/log/heat
116             environment:
117               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118       host_prep_tasks:
119         - name: create persistent logs directory
120           file:
121             path: /var/log/containers/heat
122             state: directory
123       upgrade_tasks:
124         - name: Stop and disable heat_engine service
125           tags: step2
126           service: name=openstack-heat-engine state=stopped enabled=no