Environments
Environment properties are defined as input parameters under the environments section in the composite template definition. The environments section usually includes default and environment.type sections.
environments/default
In the default section, you can specify the input parameters that apply to all environments defined in a composite template.
If an input parameter has a default value, you can use the default value or specify a user-defined value. If an input parameter does not have a default value, you must specify a user-defined value when applying the template. Use the following format to specify a value for a parameter:
paramName: paramValue
Parameter values can include references to other existing parameters with the following syntax:
paramName: ${otherParamName}
Example
In the following example, “param1” has a default value that you can use or replace. “param2” is a required parameter and you must provide a value for this parameter when applying the composite template. “param3” uses the values of “param1” and “param2” by reference.
environments:
default:
param1: default
param2: ${}
param3: ${param1},${param2}
environments/environment.type
You can specify a type for each environment defined in a composite template in the implicit environment.type parameter. In the environment.type subsections, you specify values for the parameters required for a specific environment type.
Use the environment.type sections when you want to customize the list of input parameters and their values for a particular environment type. Note that when you specify a default value for a parameter in the default section, the environment type sections use that default value, unless you specify a different default value for the same parameter in an environment.type section. You can also add an environment.type section to introduce new parameters with default or custom values.
Example
In the following example, the environment with type "dev" uses "B" as the custom value of “param2”. The environment of type "cluster" uses "default1" as the default value for “param1”, and “param3” uses the value "C".
environments:
default:
param1: default
param2: A
param3: ${param1}
dev:
param2: B
cluster:
param1: default1
param3: C
How Command Central Processes Input Parameters
The values provided for the input parameters are resolved in the following order:
1. The values from the environments/default section if this section exists
2. The values from the environments/environment.type sections
3. The user-defined values
4. If an input parameter does not have a value, Command Central returns an error.
Example:
environments:
default
param1:defaultValue
param2:
param3: ${param1},${param2}
param4: anotherValue
envType1:
param2:someValue
envType2:
param1: v1
param3: v3
The values in this example environment definition are resolved as described in the following table:
Parameters | Resolved Parameter Values |
no parameters | Error. Missing parameter values. Provide values for the parameters. |
param2=foo | param1=defaultValue param2=foo param3=defaultValue,foo param4=anotherValue |
environment.type=envType1 | param1=defaultValue param2=someValue param3=defaultValue,someValue param4=anotherValue |
environment.type=envType2 param2=foo param4=${param2} | param1=v1 param2=foo param3=v3 param4=foo |
environment.type=bar | Error. The template does not include an environment.type with value “bar”. Either provide a valid value for environment.type or leave empty to use the global default values. |
param2=foo param5=bar | param1=defaultValue param2=foo param3=defaultValue,foo param4=anotherValue param5=bar Note: | The value for param5 is not used in the template and is ignored. |
|