when "partial" DOES NOT match

42 views
Skip to first unread message

Chris Short

unread,
Feb 16, 2015, 3:23:29 PM2/16/15
to ansible...@googlegroups.com
I have a task that runs when there is a partial match on the inventory_hostname:

  when: '"lab" in inventory_hostname'

I need to figure out a way to do the opposite, meaning, when 'lab' is not in inventory_hostname the task will run. Any advice?

Giovanni Tirloni

unread,
Feb 16, 2015, 3:32:47 PM2/16/15
to ansible...@googlegroups.com
On Mon, 16 Feb 2015 12:23 -0800, Chris Short <ch...@chrisshort.net>
wrote:
> I have a task that runs when there is a partial match on the
> inventory_hostname:
>
> when: '"lab" in inventory_hostname'

when: '"lab" not in inventory_hostname'

Giovanni

Chris Short

unread,
Feb 16, 2015, 3:36:11 PM2/16/15
to ansible...@googlegroups.com
You can slap me in the back of the head should we ever meet. I can't believe I didn't try that.

Thanks,
Reply all
Reply to author
Forward
0 new messages