jinja help

I need to take this and do the opposite:

when: ansible_hostname | lower | search ("sql-db")

ie: when: not(ansible_hostname | lower | search (“ebs-db”))

Is there a good place to find out what I can/can’t do for this kind of stuff (maybe even just a cheat sheet)? I don’t know anything about jinja and don’t know the best place to start. Also, how would you change the above to exclude “sql-db” when in the ansible_hostname fact?

Not sure about your second question, but as for your first, this should work.

when: ansible_hostname | lower | search (“sql-db”) == False

No idea where I found it originally, i just dug through my own scripts for an example.

Thanks Jason. I also found that this works too:

when: not(ansible_hostname | lower | search ("sql-db"))

The Jinja template documentation is always a good start/read
http://jinja.pocoo.org/docs/2.10/templates/