- hosts:all
tasks:
- name: set fact joing the variable and the range of strings
set_fact:
exclude_addrs: "{{ split_addr | join('.')[1-5] }}"
delegate_to: localhost
В моем случае split_addr - 10.0.0, а ожидаемый вывод - 10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.4, 10.0.0.5