Make apache-based services use network-dependent servername
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 5 Sep 2016 11:39:04 +0000 (14:39 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Wed, 21 Sep 2016 09:31:33 +0000 (09:31 +0000)
Currently the servername is incorrectly set for the services running
over apache. It currently takes the default value which is just the
regular FQDN, when the services actually might be running on
different IPs that require alternative FQDNs.

This fixes that by filling that value from a fact in hiera that's
dependant on the service's network.

Closes-Bug: #1625677
Change-Id: Ib7ea5fd2d18a376eaa2f5a3fa5687cb9b719a8e2

puppet/services/aodh-api.yaml
puppet/services/ceilometer-api.yaml
puppet/services/gnocchi-api.yaml
puppet/services/keystone.yaml

index c84614b..15e9386 100644 (file)
@@ -53,6 +53,12 @@ outputs:
           - get_attr: [AodhBase, role_data, config_settings]
           - get_attr: [ApacheServiceBase, role_data, config_settings]
           - aodh::wsgi::apache::ssl: false
+            aodh::wsgi::apache::servername:
+              str_replace:
+                template:
+                  '"%{::fqdn_$NETWORK}"'
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, AodhApiNetwork]}
             aodh::api::service_name: 'httpd'
             tripleo.aodh_api.firewall_rules:
               '128 aodh-api':
index c6e3650..c8f679c 100644 (file)
@@ -71,5 +71,11 @@ outputs:
             ceilometer::api::host: {get_param: [ServiceNetMap, CeilometerApiNetwork]}
             ceilometer::wsgi::apache::bind_host: {get_param: [ServiceNetMap, CeilometerApiNetwork]}
             ceilometer::wsgi::apache::ssl: false
+            ceilometer::wsgi::apache::servername:
+              str_replace:
+                template:
+                  '"%{::fqdn_$NETWORK}"'
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, CeilometerApiNetwork]}
       step_config: |
         include ::tripleo::profile::base::ceilometer::api
index e8f25bb..07d3b01 100644 (file)
@@ -89,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
index b488fb4..e358930 100644 (file)
@@ -172,7 +172,18 @@ outputs:
                 value: 'keystone.contrib.ec2.backends.sql.Ec2'
             keystone::service_name: 'httpd'
             keystone::wsgi::apache::ssl: false
-    
+            keystone::wsgi::apache::servername:
+              str_replace:
+                template:
+                  '"%{::fqdn_$NETWORK}"'
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
+            keystone::wsgi::apache::servername_admin:
+              str_replace:
+                template:
+                  '"%{::fqdn_$NETWORK}"'
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
             keystone::wsgi::apache::workers: {get_param: KeystoneWorkers}
             # override via extraconfig:
             keystone::wsgi::apache::threads: 1