Merge "Add containerized manila-share to CI"
[apex-tripleo-heat-templates.git] / puppet / role.role.j2.yaml
index 1c9af90..85520fc 100644 (file)
@@ -1,3 +1,9 @@
+{# ## Some variables are set to enable rendering backwards compatible templates #}
+{# ## where a few parameter/resource names don't match the expected pattern #}
+{# ## FIXME: we need some way to deprecate the old inconsistent parameters #}
+{%- if role.name == 'Controller' -%}
+  {%- set deprecated_extraconfig_param  = 'controllerExtraConfig'  -%}
+{% endif %}
 heat_template_version: pike
 description: 'OpenStack {{role.name}} node configured by Puppet'
 parameters:
@@ -70,6 +76,13 @@ parameters:
     description: |
       Role specific additional hiera configuration to inject into the cluster.
     type: json
+{%- if deprecated_extraconfig_param is defined %}
+  {{deprecated_extraconfig_param}}:
+    default: {}
+    description: |
+      DEPRECATED use {{role.name}}ExtraConfig instead
+    type: json
+{%- endif %}
   {{role.name}}IPs:
     default: {}
     type: json
@@ -189,6 +202,14 @@ parameters:
           object: 0
     default: {}
 
+{% if deprecated_extraconfig_param is defined %}
+parameter_groups:
+- label: deprecated
+  description: Do not use deprecated params, they will be removed.
+  parameters:
+  - {{deprecated_extraconfig_param}}
+{%- endif %}
+
 conditions:
   server_not_blacklisted:
     not:
@@ -386,6 +407,7 @@ resources:
       server: {get_resource: {{role.name}}}
       RoleParameters: {get_param: RoleParameters}
       ServiceNames: {get_param: ServiceNames}
+      deployment_actions: {get_attr: [DeploymentActions, value]}
 
   NetworkDeployment:
     type: OS::TripleO::SoftwareDeployment
@@ -473,7 +495,12 @@ resources:
             map_replace:
               - {get_param: ServiceConfigSettings}
               - values: {get_attr: [NetIpMap, net_ip_map]}
-          {{role.name.lower()}}_extraconfig: {get_param: {{role.name}}ExtraConfig}
+          {{role.name.lower()}}_extraconfig:
+            map_merge:
+{%- if deprecated_extraconfig_param is defined %}
+              - {get_param: {{deprecated_extraconfig_param}}}
+{%- endif %}
+              - {get_param: {{role.name}}ExtraConfig}
           extraconfig: {get_param: ExtraConfig}
           {{role.name.lower()}}:
             tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
@@ -498,6 +525,9 @@ resources:
   {{role.name}}ExtraConfigPre:
     depends_on: {{role.name}}Deployment
     type: OS::TripleO::{{role.name}}ExtraConfigPre
+    # We have to use conditions here so that we don't break backwards
+    # compatibility with templates everywhere
+    condition: server_not_blacklisted
     properties:
         server: {get_resource: {{role.name}}}
 
@@ -506,6 +536,9 @@ resources:
   NodeExtraConfig:
     depends_on: [{{role.name}}ExtraConfigPre, NodeTLSCAData]
     type: OS::TripleO::NodeExtraConfig
+    # We have to use conditions here so that we don't break backwards
+    # compatibility with templates everywhere
+    condition: server_not_blacklisted
     properties:
         server: {get_resource: {{role.name}}}
 
@@ -528,11 +561,21 @@ resources:
           - ['CREATE', 'UPDATE']
           - []
 
+  DeploymentActions:
+    type: OS::Heat::Value
+    properties:
+      value:
+        if:
+          - server_not_blacklisted
+          - ['CREATE', 'UPDATE']
+          - []
+
   SshHostPubKey:
     type: OS::TripleO::Ssh::HostPubKey
     depends_on: {{role.name}}Deployment
     properties:
         server: {get_resource: {{role.name}}}
+        deployment_actions: {get_attr: [DeploymentActions, value]}
 
 outputs:
   ip_address: