Role Specific parameters for neutron-sriov-agent service
authorSanjay Upadhyay <supadhya@redhat.com>
Wed, 31 May 2017 10:06:08 +0000 (15:36 +0530)
committerSanjay Upadhyay <supadhya@redhat.com>
Thu, 8 Jun 2017 00:43:33 +0000 (06:13 +0530)
Merge the role specific parmaeter with the default parameter with the
higher precendece given to role specific parameters. Use the merged
settings for the hiera config settings.

Change-Id: I7d12ea7a26ba5c22d7961c59fb63663fc2a6b4cd
Signed-off-by: Sanjay Upadhyay <supadhya@redhat.com>
puppet/services/neutron-sriov-agent.yaml

index c124d1e..090640e 100644 (file)
@@ -65,6 +65,24 @@ resources:
       RoleName: {get_param: RoleName}
       RoleParameters: {get_param: RoleParameters}
 
+  # Merging role-specific parameters (RoleParameters) with the default parameters.
+  # RoleParameters will have the precedence over the default parameters.
+  RoleParametersValue:
+    type: OS::Heat::Value
+    properties:
+      type: json
+      value:
+        map_replace:
+          - map_replace:
+            - neutron::agents::ml2::sriov::physical_device_mappings: NeutronPhysicalDevMappings
+              neutron::agents::ml2::sriov::exclude_devices: NeutronExcludeDevices
+              tripleo::host::sriov::number_of_vfs: NeutronSriovNumVFs
+            - values: {get_param: [RoleParameters]}
+          - values:
+              NeutronPhysicalDevMappings: {get_param: NeutronPhysicalDevMappings}
+              NeutronExcludeDevices: {get_param: NeutronExcludeDevices}
+              NeutronSriovNumVFs: {get_param: NeutronSriovNumVFs}
+
 outputs:
   role_data:
     description: Role data for the Neutron SR-IOV nic agent service.
@@ -73,8 +91,6 @@ outputs:
       config_settings:
         map_merge:
           - get_attr: [NeutronBase, role_data, config_settings]
-          - neutron::agents::ml2::sriov::physical_device_mappings: {get_param: NeutronPhysicalDevMappings}
-            neutron::agents::ml2::sriov::exclude_devices: {get_param: NeutronExcludeDevices}
-            tripleo::host::sriov::number_of_vfs: {get_param: NeutronSriovNumVFs}
+          - get_attr: [RoleParametersValue, value]
       step_config: |
         include ::tripleo::profile::base::neutron::sriov