Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / aodh-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Aodh API service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   GnocchiExternalProject:
34     default: 'service'
35     description: Project name of resources creator in Gnocchi.
36     type: string
37   MonitoringSubscriptionAodhApi:
38     default: 'overcloud-ceilometer-aodh-api'
39     type: string
40   EnableInternalTLS:
41     type: boolean
42     default: false
43   AodhApiPolicies:
44     description: |
45       A hash of policies to configure for Aodh API.
46       e.g. { aodh-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
47     default: {}
48     type: json
49
50 resources:
51   AodhBase:
52     type: ./aodh-base.yaml
53     properties:
54       ServiceData: {get_param: ServiceData}
55       ServiceNetMap: {get_param: ServiceNetMap}
56       DefaultPasswords: {get_param: DefaultPasswords}
57       EndpointMap: {get_param: EndpointMap}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61   ApacheServiceBase:
62     type: ./apache.yaml
63     properties:
64       ServiceData: {get_param: ServiceData}
65       ServiceNetMap: {get_param: ServiceNetMap}
66       DefaultPasswords: {get_param: DefaultPasswords}
67       EndpointMap: {get_param: EndpointMap}
68       RoleName: {get_param: RoleName}
69       RoleParameters: {get_param: RoleParameters}
70       EnableInternalTLS: {get_param: EnableInternalTLS}
71
72 outputs:
73   role_data:
74     description: Role data for the Aodh API service.
75     value:
76       service_name: aodh_api
77       monitoring_subscription: {get_param: MonitoringSubscriptionAodhApi}
78       config_settings:
79         map_merge:
80           - get_attr: [AodhBase, role_data, config_settings]
81           - get_attr: [ApacheServiceBase, role_data, config_settings]
82           - aodh::wsgi::apache::ssl: {get_param: EnableInternalTLS}
83             aodh::wsgi::apache::servername:
84               str_replace:
85                 template:
86                   "%{hiera('fqdn_$NETWORK')}"
87                 params:
88                   $NETWORK: {get_param: [ServiceNetMap, AodhApiNetwork]}
89             aodh::wsgi::apache::wsgi_process_display_name: 'aodh_wsgi'
90             aodh::api::service_name: 'httpd'
91             aodh::api::enable_proxy_headers_parsing: true
92             aodh::api::gnocchi_external_project_owner: {get_param: GnocchiExternalProject}
93             aodh::policy::policies: {get_param: AodhApiPolicies}
94             tripleo.aodh_api.firewall_rules:
95               '128 aodh-api':
96                 dport:
97                   - 8042
98                   - 13042
99             aodh::api::host:
100               str_replace:
101                 template:
102                   "%{hiera('fqdn_$NETWORK')}"
103                 params:
104                   $NETWORK: {get_param: [ServiceNetMap, AodhApiNetwork]}
105             # NOTE: bind IP is found in Heat replacing the network name with the
106             # local node IP for the given network; replacement examples
107             # (eg. for internal_api):
108             # internal_api -> IP
109             # internal_api_uri -> [IP]
110             # internal_api_subnet - > IP/CIDR
111             aodh::wsgi::apache::bind_host: {get_param: [ServiceNetMap, AodhApiNetwork]}
112       service_config_settings:
113         get_attr: [AodhBase, role_data, service_config_settings]
114       step_config: |
115         include tripleo::profile::base::aodh::api
116       metadata_settings:
117         get_attr: [ApacheServiceBase, role_data, metadata_settings]
118       upgrade_tasks:
119         list_concat:
120           - get_attr: [ApacheServiceBase, role_data, upgrade_tasks]
121           -
122             - name: Stop aodh_api service (running under httpd)
123               tags: step1
124               service: name=httpd state=stopped