'Ansible increment ip address to multiple subnet

I would like to do the inventory of my network using ping. I found this :

- name: "Test if the ip address is already online."
  command: "ping -q -c 1 -W 1 192.168.178.{{ item }}"
  register: res
  with_sequence: start=4 end=12

The problem is that I have multiples subnets (100) like 192.169.200.0, 192.170.201.0, etc. And I don't know how to deal with it. Need some help !!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source