Puppet: define swift_store_auth_address in hiera
authorEmilien Macchi <emilien@redhat.com>
Fri, 6 Mar 2015 20:10:47 +0000 (15:10 -0500)
committerDan Prince <dprince@redhat.com>
Sat, 7 Mar 2015 03:11:55 +0000 (22:11 -0500)
This patch updates the glance::backend::swift implementation to
use only hiera variables instead of a mix of hiera, and inline
class variables.

Nothing was functionally wrong with the previous approach but now
that we can compose more freely using the SoftwareDeployment defining
all the variables in Hiera makes sense and is cleaner.

Change-Id: I6d319841488d2ed94e088a5ac21e41dcd964ed1a
Co-Authored-By: Dan Prince <dprince@redhat.com>
puppet/controller-puppet.yaml
puppet/manifests/overcloud_controller.pp

index fe03fbf..5f9bd8b 100644 (file)
@@ -449,6 +449,7 @@ resources:
         glance_port: {get_param: GlancePort}
         glance_protocol: {get_param: GlanceProtocol}
         glance_password: {get_param: GlancePassword}
         glance_port: {get_param: GlancePort}
         glance_protocol: {get_param: GlanceProtocol}
         glance_password: {get_param: GlancePassword}
+        glance_swift_store_auth_address: {list_join: ['', ['http://', {get_param: VirtualIP} , ':5000/v2.0']]}
         glance_notifier_strategy: {get_param: GlanceNotifierStrategy}
         glance_log_file: {get_param: GlanceLogFile}
         glance_dsn:
         glance_notifier_strategy: {get_param: GlanceNotifierStrategy}
         glance_log_file: {get_param: GlanceLogFile}
         glance_dsn:
@@ -615,6 +616,7 @@ resources:
                 glance::registry::database_connection: {get_input: glance_dsn}
                 glance::registry::bind_host: {get_input: controller_host}
                 glance::registry::auth_host: {get_input: controller_virtual_ip}
                 glance::registry::database_connection: {get_input: glance_dsn}
                 glance::registry::bind_host: {get_input: controller_host}
                 glance::registry::auth_host: {get_input: controller_virtual_ip}
+                glance::backend::swift::swift_store_auth_address: {get_input: glance_swift_store_auth_address}
                 glance::backend::swift::swift_store_user: service:glance
                 glance::backend::swift::swift_store_key: {get_input: glance_password}
                 # Heat
                 glance::backend::swift::swift_store_user: service:glance
                 glance::backend::swift::swift_store_key: {get_input: glance_password}
                 # Heat
index d4faf34..d6be920 100644 (file)
@@ -199,9 +199,7 @@ if hiera('step') >= 2 {
   # TODO: notifications, scrubber, etc.
   include ::glance::api
   include ::glance::registry
   # TODO: notifications, scrubber, etc.
   include ::glance::api
   include ::glance::registry
-  class { 'glance::backend::swift':
-    swift_store_auth_address => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
-  }
+  include ::glance::backend::swift
 
   class { 'nova':
     rabbit_hosts           => [hiera('controller_virtual_ip')],
 
   class { 'nova':
     rabbit_hosts           => [hiera('controller_virtual_ip')],