Add option to add metadata for the overcloud nodes
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 4 Dec 2015 13:36:30 +0000 (15:36 +0200)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 4 Dec 2015 13:36:30 +0000 (15:36 +0200)
Some Nova hooks might require custom properties/metadata set for the
servers deployed in the overcloud, and this would enable us to inject
such information.

For FreeIPA (IdM) integration, there is effectively a Nova hook that
requires such data.

Currently this inserts metadata for all servers, but a subsequent CR
will introduce per-role metadata. However, that was not added to this
because it will require the usage of map_merge. which will block those
changes to be backported. However, this one is not a problem in that
sense.

Change-Id: I98b15406525eda8dff704360d443590260430ff0

overcloud.yaml
puppet/ceph-storage.yaml
puppet/cinder-storage.yaml
puppet/compute.yaml
puppet/controller.yaml
puppet/swift-storage.yaml

index 6763618..f7074a7 100644 (file)
@@ -289,6 +289,12 @@ parameters:
     description: >
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
   # Controller-specific params
   AdminToken:
@@ -924,6 +930,7 @@ resources:
               params:
                 '%stackname%': {get_param: 'OS::stack_name'}
           NodeIndex: '%index%'
+          ServerMetadata: {get_param: ServerMetadata}
 
   Compute:
     type: OS::Heat::ResourceGroup
@@ -998,6 +1005,7 @@ resources:
               params:
                 '%stackname%': {get_param: 'OS::stack_name'}
           CloudDomain: {get_param: CloudDomain}
+          ServerMetadata: {get_param: ServerMetadata}
 
   BlockStorage:
     type: OS::Heat::ResourceGroup
@@ -1036,6 +1044,7 @@ resources:
           ExtraConfig: {get_param: ExtraConfig}
           BlockStorageExtraConfig: {get_param: BlockStorageExtraConfig}
           CloudDomain: {get_param: CloudDomain}
+          ServerMetadata: {get_param: ServerMetadata}
 
   ObjectStorage:
     type: OS::Heat::ResourceGroup
@@ -1065,6 +1074,7 @@ resources:
           ExtraConfig: {get_param: ExtraConfig}
           ObjectStorageExtraConfig: {get_param: ObjectStorageExtraConfig}
           CloudDomain: {get_param: CloudDomain}
+          ServerMetadata: {get_param: ServerMetadata}
 
   CephStorage:
     type: OS::Heat::ResourceGroup
@@ -1089,6 +1099,7 @@ resources:
           ExtraConfig: {get_param: ExtraConfig}
           CephStorageExtraConfig: {get_param: CephStorageExtraConfig}
           CloudDomain: {get_param: CloudDomain}
+          ServerMetadata: {get_param: ServerMetadata}
 
   ControllerIpListMap:
     type: OS::TripleO::Network::Ports::NetIpListMap
index 1dc20a5..b34d2c0 100644 (file)
@@ -65,6 +65,12 @@ parameters:
     description: >
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
 
 resources:
@@ -80,6 +86,7 @@ resources:
       user_data_format: SOFTWARE_CONFIG
       user_data: {get_resource: UserData}
       name: {get_param: Hostname}
+      metadata: {get_param: ServerMetadata}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
   UserData:
index f1d25e7..82c0e81 100644 (file)
@@ -118,6 +118,12 @@ parameters:
     description: >
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
 
 resources:
@@ -133,6 +139,7 @@ resources:
       user_data_format: SOFTWARE_CONFIG
       user_data: {get_resource: UserData}
       name: {get_param: Hostname}
+      metadata: {get_param: ServerMetadata}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
   UserData:
index c33373d..deedf00 100644 (file)
@@ -297,6 +297,12 @@ parameters:
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
 
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
 resources:
 
@@ -314,6 +320,7 @@ resources:
       user_data_format: SOFTWARE_CONFIG
       user_data: {get_resource: UserData}
       name: {get_param: Hostname}
+      metadata: {get_param: ServerMetadata}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
   UserData:
index 2c1c18a..417e9d4 100644 (file)
@@ -634,6 +634,12 @@ parameters:
     description: >
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
 resources:
 
@@ -649,6 +655,7 @@ resources:
       user_data_format: SOFTWARE_CONFIG
       user_data: {get_resource: UserData}
       name: {get_param: Hostname}
+      metadata: {get_param: ServerMetadata}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
   UserData:
index fbb2b87..a8183f7 100644 (file)
@@ -88,6 +88,12 @@ parameters:
     description: >
       The DNS domain used for the hosts. This should match the dhcp_domain
       configured in the Undercloud neutron. Defaults to localdomain.
+  ServerMetadata:
+    default: {}
+    description: >
+      Extra properties or metadata passed to Nova for the created nodes in
+      the overcloud. It's accessible via the Nova metadata API.
+    type: json
 
 
 resources:
@@ -103,6 +109,7 @@ resources:
       user_data_format: SOFTWARE_CONFIG
       user_data: {get_resource: UserData}
       name: {get_param: Hostname}
+      metadata: {get_param: ServerMetadata}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
   UserData: