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