ip v4 route with nexthops command: "ip route add {{ outer_item.ip_and_mask }} {{ nexthop_res }}" when: - outer_item.state is undefined or outer_item.state != "absent" - outer_item.ip_and_mask - outer_item.nexthop_ip is defined and outer_item.nexthop_ip - name: Add new ip v4 route with interface command: "ip route add {{ outer_item.ip_and_mask }} dev {{ outer_item.interface }}" when: - outer_item.state is undefined or outer_item.state != "absent" - outer_item.ip_and_mask - outer_item.interface is defined and outer_item.interface - outer_item.nexthop_ip is undefined or not outer_item.nexthop_ip 8