Add role specific information to the service template
[apex-tripleo-heat-templates.git] / puppet / services / heat-engine.yaml
1 heat_template_version: pike
2
3 description: >
4   Openstack Heat Engine service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   HeatEnableDBPurge:
30     type: boolean
31     default: true
32     description: |
33         Whether to create cron job for purging soft deleted rows in the Heat database.
34   HeatWorkers:
35     default: 0
36     description: Number of workers for Heat service.
37     type: number
38   HeatPassword:
39     description: The password for the Heat service and db account, used by the Heat services.
40     type: string
41     hidden: true
42   HeatStackDomainAdminPassword:
43     description: Password for heat_stack_domain_admin user.
44     type: string
45     hidden: true
46   HeatAuthEncryptionKey:
47     description: Auth encryption key for heat-engine
48     type: string
49     hidden: true
50     default: ''
51   MonitoringSubscriptionHeatEngine:
52     default: 'overcloud-heat-engine'
53     type: string
54   HeatEngineLoggingSource:
55     type: json
56     default:
57       tag: openstack.heat.engine
58       path: /var/log/heat/heat-engine.log
59   HeatConvergenceEngine:
60     type: boolean
61     default: true
62     description: Enables the heat engine with the convergence architecture.
63   HeatMaxResourcesPerStack:
64     type: number
65     default: 1000
66     description: Maximum resources allowed per top-level stack. -1 stands for unlimited.
67
68
69 resources:
70   HeatBase:
71     type: ./heat-base.yaml
72     properties:
73       ServiceNetMap: {get_param: ServiceNetMap}
74       DefaultPasswords: {get_param: DefaultPasswords}
75       EndpointMap: {get_param: EndpointMap}
76       RoleName: {get_param: RoleName}
77       RoleParameters: {get_param: RoleParameters}
78
79 outputs:
80   role_data:
81     description: Role data for the Heat Engine role.
82     value:
83       service_name: heat_engine
84       monitoring_subscription: {get_param: MonitoringSubscriptionHeatEngine}
85       logging_source: {get_param: HeatEngineLoggingSource}
86       logging_groups:
87         - heat
88       config_settings:
89         map_merge:
90           - get_attr: [HeatBase, role_data, config_settings]
91           - heat::engine::num_engine_workers: {get_param: HeatWorkers}
92             heat::engine::configure_delegated_roles: false
93             heat::engine::trusts_delegated_roles: []
94             heat::engine::max_nested_stack_depth: 6
95             heat::engine::max_resources_per_stack: {get_param: HeatMaxResourcesPerStack}
96             heat::engine::heat_metadata_server_url:
97               make_url:
98                 scheme: {get_param: [EndpointMap, HeatCfnPublic, protocol]}
99                 host: {get_param: [EndpointMap, HeatCfnPublic, host]}
100                 port: {get_param: [EndpointMap, HeatCfnPublic, port]}
101             heat::engine::heat_waitcondition_server_url:
102               make_url:
103                 scheme: {get_param: [EndpointMap, HeatCfnPublic, protocol]}
104                 host: {get_param: [EndpointMap, HeatCfnPublic, host]}
105                 port: {get_param: [EndpointMap, HeatCfnPublic, port]}
106                 path: /v1/waitcondition
107             heat::engine::convergence_engine: {get_param: HeatConvergenceEngine}
108             tripleo::profile::base::heat::manage_db_purge: {get_param: HeatEnableDBPurge}
109             heat::database_connection:
110               make_url:
111                 scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
112                 username: heat
113                 password: {get_param: HeatPassword}
114                 host: {get_param: [EndpointMap, MysqlInternal, host]}
115                 path: /heat
116                 query:
117                   read_default_file: /etc/my.cnf.d/tripleo.cnf
118                   read_default_group: tripleo
119             heat::keystone_ec2_uri:
120               list_join:
121               - ''
122               - - {get_param: [EndpointMap, KeystoneV3Internal, uri]}
123                 - '/ec2tokens'
124             heat::keystone::domain::domain_password: {get_param: HeatStackDomainAdminPassword}
125             heat::engine::auth_encryption_key:
126               yaql:
127                 expression: $.data.passwords.where($ != '').first()
128                 data:
129                   passwords:
130                     - {get_param: HeatAuthEncryptionKey}
131                     - {get_param: [DefaultPasswords, heat_auth_encryption_key]}
132       step_config: |
133         include ::tripleo::profile::base::heat::engine
134
135       service_config_settings:
136         mysql:
137           heat::db::mysql::password: {get_param: HeatPassword}
138           heat::db::mysql::user: heat
139           heat::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
140           heat::db::mysql::dbname: heat
141           heat::db::mysql::allowed_hosts:
142             - '%'
143             - "%{hiera('mysql_bind_host')}"
144         keystone:
145             # This is needed because the keystone profile handles creating the domain
146             tripleo::profile::base::keystone::heat_admin_password: {get_param: HeatStackDomainAdminPassword}
147       upgrade_tasks:
148         - name: Check if heat_engine is deployed
149           command: systemctl is-enabled openstack-heat-engine
150           tags: common
151           ignore_errors: True
152           register: heat_engine_enabled
153         - name: "PreUpgrade step0,validation: Check service openstack-heat-engine is running"
154           shell: /usr/bin/systemctl show 'openstack-heat-engine' --property ActiveState | grep '\bactive\b'
155           when: heat_engine_enabled.rc == 0
156           tags: step0,validation
157         - name: Stop heat_engine service
158           tags: step1
159           when: heat_engine_enabled.rc == 0
160           service: name=openstack-heat-engine state=stopped