Create memcache_servers list in swift proxy profile
authorSteven Hardy <shardy@redhat.com>
Thu, 1 Sep 2016 14:46:01 +0000 (15:46 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 1 Sep 2016 15:51:24 +0000 (16:51 +0100)
Instead of mangling this list in t-h-t, generate the list derived
from memcached_node_ips, which is now always set when memcached
is deployed, regardless of the role.

Note the port default is hard-coded as this is already hard-coded
(in two places) in t-h-t, but we can override it if this changes
in future.

We need this to remove the swift specific stuff out of overcloud.yaml
to enable custom-roles.

Change-Id: Ic8872e5e51732874ca5b93bff5efd3e7ed75bc31
Partially-Implements: blueprint custom-roles

manifests/profile/base/swift/proxy.pp

index 1e763a1..a95d05f 100644 (file)
 #   for more details.
 #   Defaults to hiera('step')
 #
+# [*memcache_servers*]
+#   (Optional) List of memcache servers
+#   Defaults to hiera('memcached_node_ips')
+#
+# [*memcache_port*]
+#   (Optional) memcache port
+#   Defaults to 11211
+#
 class tripleo::profile::base::swift::proxy (
   $step = hiera('step'),
+  $memcache_servers = hiera('memcached_node_ips'),
+  $memcache_port = 11211,
 ) {
   if $step >= 4 {
+    $swift_memcache_servers = suffix($memcache_servers, ":${memcache_port}")
     include ::swift::proxy
     include ::swift::proxy::proxy_logging
     include ::swift::proxy::healthcheck
-    include ::swift::proxy::cache
+    class { '::swift::proxy::cache':
+      memcache_servers => $swift_memcache_servers
+    }
     include ::swift::proxy::keystone
     include ::swift::proxy::authtoken
     include ::swift::proxy::staticweb