Merge "Add NodeAdminUserData interface for "heat-admin" user"
[apex-tripleo-heat-templates.git] / puppet / swift-storage-puppet.yaml
index dc6ff89..5c4ff5a 100644 (file)
@@ -65,6 +65,18 @@ parameters:
   Hostname:
     type: string
     default: '' # Defaults to Heat created hostname
+  ExtraConfig:
+    default: {}
+    description: |
+      Additional hiera configuration to inject into the cluster. Note
+      that ObjectStorageExtraConfig takes precedence over ExtraConfig.
+    type: json
+  ObjectStorageExtraConfig:
+    default: {}
+    description: |
+      Role specific additional hiera configuration to inject into the cluster.
+    type: json
+
 
 resources:
 
@@ -77,9 +89,26 @@ resources:
       networks:
         - network: ctlplane
       user_data_format: SOFTWARE_CONFIG
-      user_data: {get_resource: NodeUserData}
+      user_data: {get_resource: UserData}
       name: {get_param: Hostname}
 
+  # Combine the NodeAdminUserData and NodeUserData mime archives
+  UserData:
+    type: OS::Heat::MultipartMime
+    properties:
+      parts:
+      - config: {get_resource: NodeAdminUserData}
+        type: multipart
+      - config: {get_resource: NodeUserData}
+        type: multipart
+
+  # Creates the "heat-admin" user if configured via the environment
+  # Should return a OS::Heat::MultipartMime reference via OS::stack_id
+  NodeAdminUserData:
+    type: OS::TripleO::NodeAdminUserData
+
+  # For optional operator additional userdata
+  # Should return a OS::Heat::MultipartMime reference via OS::stack_id
   NodeUserData:
     type: OS::TripleO::NodeUserData
 
@@ -108,6 +137,7 @@ resources:
   NetIpMap:
     type: OS::TripleO::Network::Ports::NetIpMap
     properties:
+      ControlPlaneIp: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
       StorageIp: {get_attr: [StoragePort, ip_address]}
       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
@@ -126,6 +156,8 @@ resources:
         hiera:
           hierarchy:
             - heat_config_%{::deploy_config_name}
+            - object_extraconfig
+            - extraconfig
             - object
             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
             - all_nodes # provided by allNodesConfig
@@ -134,6 +166,10 @@ resources:
           datafiles:
             common:
               raw_data: {get_file: hieradata/common.yaml}
+            object_extraconfig:
+              mapped_data: {get_param: ObjectStorageExtraConfig}
+            extraconfig:
+              mapped_data: {get_param: ExtraConfig}
             object:
               raw_data: {get_file: hieradata/object.yaml}
               mapped_data: # data supplied directly to this deployment configuration, etc