con2 / emrichen

A Template engine for YAML & JSON
MIT License
107 stars 11 forks source link

Help understanding !If (include file only if var is set) #76

Open mrambossek opened 2 months ago

mrambossek commented 2 months ago

hi - struggling again, asking for help :)

  systemd:
    units: !Concat
      - !Include units/ALL.yaml
      - !Include units/docker_compose.yaml
      - !Include units/mount_docker.yaml
      - !Include units/mount_data.yaml
      - !If
        test: !Op [!Void, ne, !Var etcd_token]
        then: !Include units/etcd.yaml

i want to check if one of the "parent" files set the variable etcd_token - and if so, include the file.. is this doable? TIA!