Providing parameters specific to a workflow via plan-environment
[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_3:
84           heat_init_log:
85             start_order: 0
86             image: *heat_engine_image
87             user: root
88             volumes:
89               - /var/log/containers/heat:/var/log/heat
90             command: ['/bin/bash', '-c', 'chown -R heat:heat /var/log/heat']
91           heat_engine_db_sync:
92             start_order: 1
93             image: *heat_engine_image
94             net: host
95             privileged: false
96             detach: false
97             user: root
98             volumes:
99               list_concat:
100                 - {get_attr: [ContainersCommon, volumes]}
101                 -
102                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
103                   - /var/log/containers/heat:/var/log/heat
104             command: "/usr/bin/bootstrap_host_exec heat_engine su heat -s /bin/bash -c 'heat-manage db_sync'"
105         step_4:
106           heat_engine:
107             image: *heat_engine_image
108             net: host
109             privileged: false
110             restart: always
111             volumes:
112               list_concat:
113                 - {get_attr: [ContainersCommon, volumes]}
114                 -
115                   - /var/lib/kolla/config_files/heat_engine.json:/var/lib/kolla/config_files/config.json:ro
116                   - /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
117                   - /var/log/containers/heat:/var/log/heat
118             environment:
119               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
120       host_prep_tasks:
121         - name: create persistent logs directory
122           file:
123             path: /var/log/containers/heat
124             state: directory
125       upgrade_tasks:
126         - name: Stop and disable heat_engine service
127           tags: step2
128           service: name=openstack-heat-engine state=stopped enabled=no