I need to automatically calculate one volume size based on another. Simplified example:
There is an input parameter
data_disk_size:
type: number
default: 50
And we want second volume to be: 100 if 1 < data_disk_size < 200; 200 if 200 < data_disk_size < 400; else 400
As i understood, conditions block would not help as it operates only with boolean values and available options are if and yaql. But i could not manage to use them together:
instance_volume_2:
type: OS::Cinder::Volume
properties:
...
size:
if:
- yaql:
expression: $.data > 1 and $.data < 200
data: {get_param: data_disk_size}
- 100
- 200 {only for test, there should be nested if}
It gives:
'ERROR: if.yaql: The function "yaql" is invalid in this context'
So the only remaining option is pure yaql, BUT it has no if operator!
What am i missing? Maybe there is simple way to do it?