Ansible behaves correctly as currently allowed_ips
is not a list but a single variable. Make the variable a YAML list:
---
allowed_ips:
- xxx.xxx.xxx.xxx
- xxx.xxx.xxx.xxx
Now the action is executed as many times as there is items in the allowed_ips
list.