Add global_config_settings to services' output
authorGiulio Fidente <gfidente@redhat.com>
Fri, 1 Jul 2016 12:45:31 +0000 (14:45 +0200)
committerGiulio Fidente <gfidente@redhat.com>
Fri, 26 Aug 2016 09:11:47 +0000 (11:11 +0200)
The new global_config_settings output is meant to contain
additional hieradata distributed by the services to all role types.

Change-Id: I1beff8f7b12a4178e6081de6134cd8e67794d710

overcloud.yaml
puppet/services/README.rst
puppet/services/services.yaml

index d60e822..47a59bd 100644 (file)
@@ -410,7 +410,15 @@ resources:
               params:
                 '%stackname%': {get_param: 'OS::stack_name'}
           NodeIndex: '%index%'
-          ServiceConfigSettings: {get_attr: [ControllerServiceChain, role_data, config_settings]}
+          ServiceConfigSettings:
+            map_merge:
+              - get_attr: [ControllerServiceChain, role_data, config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
+              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
+              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
           ServiceNames: {get_attr: [ControllerServiceChain, role_data, service_names]}
 
   ComputeServiceChain:
@@ -441,7 +449,14 @@ resources:
               params:
                 '%stackname%': {get_param: 'OS::stack_name'}
           NodeIndex: '%index%'
-          ServiceConfigSettings: {get_attr: [ComputeServiceChain, role_data, config_settings]}
+          ServiceConfigSettings:
+            map_merge:
+              - get_attr: [ComputeServiceChain, role_data, config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
+              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
+              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
           ServiceNames: {get_attr: [ComputeServiceChain, role_data, service_names]}
 
   BlockStorageServiceChain:
@@ -473,7 +488,14 @@ resources:
           CloudDomain: {get_param: CloudDomain}
           ServerMetadata: {get_param: ServerMetadata}
           NodeIndex: '%index%'
-          ServiceConfigSettings: {get_attr: [BlockStorageServiceChain, role_data, config_settings]}
+          ServiceConfigSettings:
+            map_merge:
+              - get_attr: [BlockStorageServiceChain, role_data, config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
+              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
+              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
           ServiceNames: {get_attr: [BlockStorageServiceChain, role_data, service_names]}
 
   ObjectStorageServiceChain:
@@ -505,7 +527,14 @@ resources:
           CloudDomain: {get_param: CloudDomain}
           ServerMetadata: {get_param: ServerMetadata}
           NodeIndex: '%index%'
-          ServiceConfigSettings: {get_attr: [ObjectStorageServiceChain, role_data, config_settings]}
+          ServiceConfigSettings:
+            map_merge:
+              - get_attr: [ObjectStorageServiceChain, role_data, config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
+              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
+              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
           ServiceNames: {get_attr: [ObjectStorageServiceChain, role_data, service_names]}
 
   CephStorageServiceChain:
@@ -537,7 +566,14 @@ resources:
           CloudDomain: {get_param: CloudDomain}
           ServerMetadata: {get_param: ServerMetadata}
           NodeIndex: '%index%'
-          ServiceConfigSettings: {get_attr: [CephStorageServiceChain, role_data, config_settings]}
+          ServiceConfigSettings:
+            map_merge:
+              - get_attr: [CephStorageServiceChain, role_data, config_settings]
+              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
+              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
+              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
+              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
           ServiceNames: {get_attr: [CephStorageServiceChain, role_data, service_names]}
 
   ControllerIpListMap:
index 15c8c1f..8fe51fa 100644 (file)
@@ -31,6 +31,8 @@ are re-asserted when applying latter ones.
 
  * config_settings: Custom hiera settings for this service.
 
+ * global_config_settings: Additional hiera settings distributed to all roles.
+
  * step_config: A puppet manifest that is used to step through the deployment
    sequence. Each sequence is given a "step" (via hiera('step') that provides
    information for when puppet classes should activate themselves.
index bb40001..61606e6 100644 (file)
@@ -50,4 +50,9 @@ outputs:
           expression: list($.data.s_names.where($ != null))
           data: {s_names: {get_attr: [ServiceChain, role_data, service_name]}}
       config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}}
+      global_config_settings:
+        map_merge:
+          yaql:
+            expression: list($.data.configs.where($ != null))
+            data: {configs: {get_attr: [ServiceChain, role_data, global_config_settings]}}
       step_config: {list_join: ["\n", {get_attr: [ServiceChain, role_data, step_config]}]}