Make apache-based services use network-dependent servername
[apex-tripleo-heat-templates.git] / puppet / services / gnocchi-api.yaml
index ec42f3f..07d3b01 100644 (file)
@@ -33,8 +33,17 @@ parameters:
     type: string
     default: 'regionOne'
     description: Keystone region for endpoint
+  MonitoringSubscriptionGnocchiApi:
+    default: 'overcloud-gnocchi-api'
+    type: string
+  GnocchiApiLoggingSource:
+    type: json
+    default:
+      tag: openstack.gnocchi.api
+      path: /var/log/gnocchi/app.log
 
 resources:
+
   GnocchiServiceBase:
     type: ./gnocchi-base.yaml
     properties:
@@ -42,13 +51,25 @@ resources:
       DefaultPasswords: {get_param: DefaultPasswords}
       EndpointMap: {get_param: EndpointMap}
 
+  ApacheServiceBase:
+    type: ./apache.yaml
+    properties:
+      ServiceNetMap: {get_param: ServiceNetMap}
+      DefaultPasswords: {get_param: DefaultPasswords}
+      EndpointMap: {get_param: EndpointMap}
+
 outputs:
   role_data:
     description: Role data for the Gnocchi role.
     value:
       service_name: gnocchi_api
+      monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiApi}
+      logging_source: {get_param: GnocchiApiLoggingSource}
+      logging_groups:
+        - gnocchi
       config_settings:
         map_merge:
+          - get_attr: [ApacheServiceBase, role_data, config_settings]
           - get_attr: [GnocchiServiceBase, role_data, config_settings]
           - tripleo.gnocchi_api.firewall_rules:
               '129 gnocchi-api':
@@ -68,6 +89,12 @@ outputs:
             gnocchi::keystone::authtoken::password: {get_param: GnocchiPassword}
             gnocchi::keystone::authtoken::project_name: 'service'
             gnocchi::wsgi::apache::ssl: false
+            gnocchi::wsgi::apache::servername:
+              str_replace:
+                template:
+                  '"%{::fqdn_$NETWORK}"'
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
             tripleo::profile::base::gnocchi::api::gnocchi_backend: {get_param: GnocchiBackend}
             # NOTE: bind IP is found in Heat replacing the network name with the
             # local node IP for the given network; replacement examples