run task based on host network

15 views
Skip to first unread message

ניר פישר

unread,
Jan 5, 2022, 3:55:00 PM1/5/22
to Ansible Project
Hi 
I am trying to run a task based on ansible facts ipv4 of the host 
currently I am able to do so with "when" and regex 
it works when I am trying to match this for example:
"192.168.[1,2]."
but I need another subnet in the same regex for example
"10.10.[8,9.]"
how can I combine the 2 ?
either with regex or maybe create a list of subnets that the IP will match
like :
subnets:
  - 192.168.2.0.24

and so in 

thanks

Reply all
Reply to author
Forward
0 new messages