rougail-output-doc/tests/docs/examples/60_5family_dynamic_unknown_suffix_empty.md

1.2 KiB

Table of Contents

dictionaries/rougail/00-base.yml

---
version: '1.1'
var:
  description: a suffix variable
  multi: true
  mandatory: false
  test:
    - val1
    - val2
    - val3
    - val4

'{{ identifier }}_dyn':
  description: a dynamic family
  dynamic:
    variable: _.var

  var1:
    description: a variable 1
    default:
      type: identifier

  var2:
    description: a variable 2
    default:
      variable: rougail.{{ identifier }}_dyn.var1

  var3:
    description: a variable 3
    default:
      variable: _.var1

  var4:
    description: a variable 4
    default:
      variable: rougail.val4_dyn.var1
    disabled:
      jinja: |
        {% if 'val4' not in __.var %}
        val4 is not a valid value
        {% endif %}        

Example with all variables modifiable

---
rougail:
  var:
    - val1
    - val2
    - val3
    - val4
  val1_dyn:
    var1: val1
    var2: val1
    var3: val1
    var4: val4
  val2_dyn:
    var1: val2
    var2: val2
    var3: val2
    var4: val4
  val3_dyn:
    var1: val3
    var2: val3
    var3: val3
    var4: val4
  val4_dyn:
    var1: val4
    var2: val4
    var3: val4
    var4: val4