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