LINE=” This string must be included{% if value1 is defined %}
this string is optional= {{ value1 }}{% endif %}”On Thu, 1 Jul 2021 at 08:17, [email protected] <[email protected]> wrote: > > Ansible question > I have a variable, let call it value1 and a J2 template. > > The J2 template includes the following line : > LINE=” This string mut be included this string is optional= {{ value1}}” > > What I need to implement > > If value1 is defined with a string – let assume that the string is OK > (Value1: OK) > , the file should be > LINE=” This string must be included this string is optional= OK” > > > If value1 is not defined (empty Value1: ) –the file should be > LINE=” This string must be included” > > So how the J2 should be configured? > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/f9c56cbd-6356-4efd-b0d7-2e6abe9faf9dn%40googlegroups.com. -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwNEbHLTzQwdkWPX%2B8rmhmfsJ1%2BVHc_T%2BAeyGzu%2BxQxbKA%40mail.gmail.com.
