Merge "Role Specific paramaeter support for neutron-ovs-dpdk-agent service"
[apex-tripleo-heat-templates.git] / puppet / services / heat-api-cfn.yaml
1 heat_template_version: pike
2
3 description: >
4   Openstack Heat CloudFormation API 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   HeatWorkers:
30     default: 0
31     description: Number of workers for Heat service.
32     type: number
33   HeatPassword:
34     description: The password for the Heat service and db account, used by the Heat services.
35     type: string
36     hidden: true
37   KeystoneRegion:
38     type: string
39     default: 'regionOne'
40     description: Keystone region for endpoint
41   MonitoringSubscriptionHeatApiCnf:
42     default: 'overcloud-heat-api-cfn'
43     type: string
44   HeatApiCfnLoggingSource:
45     type: json
46     default:
47       tag: openstack.heat.api.cfn
48       path: /var/log/heat/heat-api-cfn.log
49   EnableInternalTLS:
50     type: boolean
51     default: false
52
53 conditions:
54   heat_workers_zero: {equals : [{get_param: HeatWorkers}, 0]}
55
56 resources:
57
58   ApacheServiceBase:
59     type: ./apache.yaml
60     properties:
61       ServiceNetMap: {get_param: ServiceNetMap}
62       DefaultPasswords: {get_param: DefaultPasswords}
63       EndpointMap: {get_param: EndpointMap}
64       RoleName: {get_param: RoleName}
65       RoleParameters: {get_param: RoleParameters}
66       EnableInternalTLS: {get_param: EnableInternalTLS}
67
68   HeatBase:
69     type: ./heat-base.yaml
70     properties:
71       ServiceNetMap: {get_param: ServiceNetMap}
72       DefaultPasswords: {get_param: DefaultPasswords}
73       EndpointMap: {get_param: EndpointMap}
74       RoleName: {get_param: RoleName}
75       RoleParameters: {get_param: RoleParameters}
76
77 outputs:
78   role_data:
79     description: Role data for the Heat CloudFormation API role.
80     value:
81       service_name: heat_api_cfn
82       monitoring_subscription: {get_param: MonitoringSubscriptionHeatApiCnf}
83       logging_source: {get_param: HeatApiCfnLoggingSource}
84       logging_groups:
85         - heat
86       config_settings:
87         map_merge:
88           - get_attr: [HeatBase, role_data, config_settings]
89           - get_attr: [ApacheServiceBase, role_data, config_settings]
90           - tripleo.heat_api_cfn.firewall_rules:
91               '125 heat_cfn':
92                 dport:
93                   - 8000
94                   - 13800
95             heat::api_cfn::bind_host: {get_param: [ServiceNetMap, HeatApiCfnNetwork]}
96             heat::wsgi::apache_api_cfn::ssl: {get_param: EnableInternalTLS}
97             heat::api_cfn::service_name: 'httpd'
98             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
99             # for the given network; replacement examples (eg. for internal_api):
100             # internal_api -> IP
101             # internal_api_uri -> [IP]
102             # internal_api_subnet - > IP/CIDR
103             heat::wsgi::apache_api_cfn::bind_host: {get_param: [ServiceNetMap, HeatApiCfnNetwork]}
104             heat::wsgi::apache_api_cfn::servername:
105               str_replace:
106                 template:
107                   "%{hiera('fqdn_$NETWORK')}"
108                 params:
109                   $NETWORK: {get_param: [ServiceNetMap, HeatApiCfnNetwork]}
110           -
111             if:
112             - heat_workers_zero
113             - {}
114             - heat::wsgi::apache_api_cfn::workers: {get_param: HeatWorkers}
115       step_config: |
116         include ::tripleo::profile::base::heat::api_cfn
117       service_config_settings:
118         keystone:
119           map_merge:
120             - get_attr: [HeatBase, role_data, service_config_settings, keystone]
121             - heat::keystone::auth_cfn::tenant: 'service'
122               heat::keystone::auth_cfn::public_url: {get_param: [EndpointMap, HeatCfnPublic, uri]}
123               heat::keystone::auth_cfn::internal_url: {get_param: [EndpointMap, HeatCfnInternal, uri]}
124               heat::keystone::auth_cfn::admin_url: {get_param: [EndpointMap, HeatCfnAdmin, uri]}
125               heat::keystone::auth_cfn::password: {get_param: HeatPassword}
126               heat::keystone::auth_cfn::region: {get_param: KeystoneRegion}
127       upgrade_tasks:
128         - name: Check if heat_api_cfn is deployed
129           command: systemctl is-enabled openstack-heat-api-cfn
130           tags: common
131           ignore_errors: True
132           register: heat_api_cfn_enabled
133         - name: "PreUpgrade step0,validation: Check service openstack-heat-api-cfn is running"
134           shell: /usr/bin/systemctl show 'openstack-heat-api-cfn' --property ActiveState | grep '\bactive\b'
135           when: heat_api_cfn_enabled.rc == 0
136           tags: step0,validation
137         - name: check for heat_api_cfn running under apache (post upgrade)
138           tags: step1
139           shell: "httpd -t -D DUMP_VHOSTS | grep -q heat_api_cfn_wsgi"
140           register: heat_api_cfn_apache
141           ignore_errors: true
142         - name: Stop heat_api_cfn service (running under httpd)
143           tags: step1
144           service: name=httpd state=stopped
145           when: heat_api_cfn_apache.rc == 0
146         - name: Stop and disable heat_api_cfn service (pre-upgrade not under httpd)
147           tags: step1
148           when: heat_api_cfn_apache.rc == 0
149           service: name=openstack-heat-api-cfn state=stopped enabled=no