Combining Conditionals in Replicated Config

Question from today

I need to add an additional “ConfigOptionsEquals” condition and/or condition to enable more nesting of configs.

  - name: database_password
    title: Database Password
    type: password
    when: '{{repl (ConfigOptionEquals "db_type" "external")}}' || '{{repl (ConfigOptionEquals "somefeature" "no"}}'

Since Replicated’s templating is based on go templating, you can use any built in functions there. For Example, the above could be written as

 - name: database_password
   title: Database Password
   type: password
   when: '{{repl (or (ConfigOptionEquals "db_type" "external") (ConfigOptionEquals "somefeature" "no") ) }}'
2 Likes

Thanks @dex ! Also got do know about the Go templating tie-in I didn’t know that.

1 Like