Merge "Swift proxy align *-quotas with puppet-swift syntax"
[apex-tripleo-heat-templates.git] / puppet / compute-role.yaml
index 2eb287c..62adcd3 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: 2016-10-14
+heat_template_version: ocata
 
 description: >
   OpenStack hypervisor node configured via Puppet.
@@ -120,10 +120,19 @@ parameters:
   MonitoringSubscriptions:
     type: comma_delimited_list
     default: []
+  ServiceMetadataSettings:
+    type: json
+    default: {}
   ConfigCommand:
     type: string
     description: Command which will be run whenever configuration data changes
     default: os-refresh-config --timeout 14400
+  UpgradeInitCommand:
+    type: string
+    description: |
+      Command or script snippet to run on all overcloud nodes to
+      initialize the upgrade process. E.g. a repository switch.
+    default: ''
 
 resources:
 
@@ -151,6 +160,7 @@ resources:
         map_merge:
           - {get_param: ServerMetadata}
           - {get_param: NovaComputeServerMetadata}
+          - {get_param: ServiceMetadataSettings}
       scheduler_hints: {get_param: NovaComputeSchedulerHints}
 
   # Combine the NodeAdminUserData and NodeUserData mime archives
@@ -335,6 +345,11 @@ resources:
             - - {get_attr: [NovaCompute, name]}
               - ctlplane
 
+  PreNetworkConfig:
+    type: OS::TripleO::Compute::PreNetworkConfig
+    properties:
+      server: {get_resource: NovaCompute}
+
   NetworkConfig:
     type: OS::TripleO::Compute::Net::SoftwareConfig
     properties:
@@ -348,6 +363,7 @@ resources:
 
   NetworkDeployment:
     type: OS::TripleO::SoftwareDeployment
+    depends_on: PreNetworkConfig
     properties:
       name: NetworkDeployment
       config: {get_resource: NetworkConfig}
@@ -357,6 +373,27 @@ resources:
         bridge_name: {get_param: NeutronPhysicalBridge}
         interface_name: {get_param: NeutronPublicInterface}
 
+  NovaComputeUpgradeInitConfig:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      group: script
+      config:
+        list_join:
+        - ''
+        - - "#!/bin/bash\n\n"
+          - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
+          - get_param: UpgradeInitCommand
+
+  # Note we may be able to make this conditional on UpgradeInitCommandNotEmpty
+  # but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first
+  NovaComputeUpgradeInitDeployment:
+    type: OS::Heat::SoftwareDeployment
+    depends_on: NetworkDeployment
+    properties:
+      name: NovaComputeUpgradeInitDeployment
+      server: {get_resource: NovaCompute}
+      config: {get_resource: NovaComputeUpgradeInitConfig}
+
   NovaComputeConfig:
     type: OS::Heat::StructuredConfig
     properties:
@@ -402,7 +439,7 @@ resources:
 
   NovaComputeDeployment:
     type: OS::TripleO::SoftwareDeployment
-    depends_on: NetworkDeployment
+    depends_on: NovaComputeUpgradeInitDeployment
     properties:
       name: NovaComputeDeployment
       config: {get_resource: NovaComputeConfig}