I am trying to write a regular expression for a dynamic group in ansible-playbook for an sample ip range. if the address range is 172.30.0.(0 to 254).(0 to 254). My regex is like 172.30.[0-254].[0-254]. Is this correct ? Even though I have the hosts in the range, the tasks are being skipped and no groups are being formed.
tasks: - group_by: key=adda when: ansible_default_ipv4.network == '172.30.[0-254].[0-254]'