Merge "Fixup for manila-api containerized service"
[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     type: json
37
38
39 resources:
40
41   ContainersCommon:
42     type: ./containers-common.yaml
43
44   HeatBase:
45     type: ../../puppet/services/heat-engine.yaml
46     properties:
47       EndpointMap: {get_param: EndpointMap}
48       ServiceNetMap: {get_param: ServiceNetMap}
49       DefaultPasswords: {get_param: DefaultPasswords}
50       RoleName: {get_param: RoleName}
51       RoleParameters: {get_param: RoleParameters}
52
53 outputs:
54   role_data:
55     description: Role data for the Heat Engine role.
56     value:
57       service_name: {get_attr: [HeatBase, role_data, service_name]}
58       config_settings:
59         map_merge:
60           - get_attr: [HeatBase, role_data, config_settings]
61           - apache::default_vhost: false
62       step_config: &step_config
63         get_attr: [HeatBase, role_data, step_config]
64       service_config_settings: {get_attr: [HeatBase, role_data, service_config_settings]}
65       # BEGIN DOCKER SETTINGS
66       puppet_config:
67         config_volume: heat
68         puppet_tags: heat_config,file,concat,file_line
69         step_config: *step_config
70         config_image: &heat_engine_image
71           list_join:
72             - '/'
73             - [ {get_param: DockerNamespace}, {get_param: DockerHeatEngineImage} ]
74       kolla_config:
75         /var/lib/kolla/config_files/heat_engine.json:
76           command: /usr/bin/heat-engine --config-file /usr/share/heat/heat-dist.conf --config-file /etc/heat/heat.conf
77           permissions:
78             - path: /var/log/heat
79               owner: heat:heat
80               recurse: true
81       docker_config:
82         # db sync runs before permissions set by kolla_config
83         step_2:
84           heat_init_log:
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         step_3:
91           heat_engine_db_sync:
92             image: *heat_engine_image
93             net: host
94             privileged: false
95             detach: false
96             user: root
97             volumes:
98               list_concat:
99                 - {get_attr: [ContainersCommon, volumes]}
100                 -
101                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
102                   - /var/log/containers/heat:/var/log/heat
103             command: "/usr/bin/bootstrap_host_exec heat_engine su heat -s /bin/bash -c 'heat-manage db_sync'"
104         step_4:
105           heat_engine:
106             image: *heat_engine_image
107             net: host
108             privileged: false
109             restart: always
110             volumes:
111               list_concat:
112                 - {get_attr: [ContainersCommon, volumes]}
113                 -
114                   - /var/lib/kolla/config_files/heat_engine.json:/var/lib/kolla/config_files/config.json:ro
115                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
116                   - /var/log/containers/heat:/var/log/heat
117             environment:
118               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
119       host_prep_tasks:
120         - name: create persistent logs directory
121           file:
122             path: /var/log/containers/heat
123             state: directory
124       upgrade_tasks:
125         - name: Stop and disable heat_engine service
126           tags: step2
127           service: name=openstack-heat-engine state=stopped enabled=no