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