---
- name: "Ip: Check if 10.1.1.1 is a valid IP address"
  ansible.builtin.assert:
    that: "{{ '10.1.1.1' is ansible.utils.ip }}"

- name: "Ip: Check if 2001:db8:a::123 is a valid IP address"
  ansible.builtin.assert:
    that: "{{ '2001:db8:a::123' is ansible.utils.ip }}"

- name: "Ip: Check if 10.0.0.0/8 is a valid IP address"
  ansible.builtin.assert:
    that: "{{ '10.0.0.0/8' is ansible.utils.ip }}"

- name: "Ip: Test invalidness"
  ansible.builtin.set_fact:
    criteria_check1: "{{ 'string' is ansible.utils.ip }}"

- name: "Ip: Assert invalidness"
  ansible.builtin.assert:
    that: "{{ criteria_check1 == false }}"

- name: "Ip: Test invalidness"
  ansible.builtin.set_fact:
    criteria_check2: "{{ '300.1.1.1' is ansible.utils.ip }}"

- name: "Ip: Assert invalidness"
  ansible.builtin.assert:
    that: "{{ criteria_check2 == false }}"
