
    Vh                     f    d Z ddlmZmZmZ ddlmZmZmZ e	Z
dZdZdZed        Z G d d	e      Zy
)z1
Test plugin file for netaddr tests: unspecified
    )absolute_importdivisionprint_function)_need_ipaddress_validate_args
ip_addressa  
    name: unspecified
    author: Priyam Sahoo (@priyamsahoo)
    version_added: "2.2.0"
    short_description: Test for an unspecified IP address
    description:
        - This plugin checks if the provided value is an unspecified IP address
    options:
        ip:
            description:
            - A string that represents the value against which the test is going to be performed
            - 'For example: C(0.0.0.0), C(0:0:0:0:0:0:0:0), C(::), or C(::1)'
            type: str
            required: True
    notes:
aK  

#### Simple examples

- name: Check if 0.0.0.0 is an unspecified IP address
  ansible.builtin.set_fact:
    data: "{{ '0.0.0.0' is ansible.utils.unspecified }}"

# TASK [Check if 0.0.0.0 is an unspecified IP address] ***************************
# ok: [localhost] => {
#     "ansible_facts": {
#         "data": true
#     },
#     "changed": false
# }

- name: Check if 0:0:0:0:0:0:0:0 is an unspecified IP address
  ansible.builtin.set_fact:
    data: "{{ '0:0:0:0:0:0:0:0' is ansible.utils.unspecified }}"

# TASK [Check if 0:0:0:0:0:0:0:0 is an unspecified IP address] *******************
# ok: [localhost] => {
#     "ansible_facts": {
#         "data": true
#     },
#     "changed": false
# }

- name: Check if "::" is an unspecified IP address
  ansible.builtin.set_fact:
    data: "{{ '::' is ansible.utils.unspecified }}"

# TASK [Check if "::" is an unspecified IP address] ******************************
# ok: [localhost] => {
#     "ansible_facts": {
#         "data": true
#     },
#     "changed": false
# }

- name: Check if ::1 is not an unspecified IP address
  ansible.builtin.set_fact:
    data: "{{ '::1' is not ansible.utils.unspecified }}"

# TASK [Check if ::1 is not an unspecified IP address] ***************************
# ok: [localhost] => {
#     "ansible_facts": {
#         "data": true
#     },
#     "changed": false
# }
z
  data:
    description:
      - If jinja test satisfies plugin expression C(true)
      - If jinja test does not satisfy plugin expression C(false)
c                 v    d| i}t        dt        |       	 t        |       j                  S # t        $ r Y yw xY w)z"Test for an unspecified IP addressipunspecifiedF)r   DOCUMENTATIONr   is_unspecified	Exception)r
   paramss     j/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ansible/utils/plugins/test/unspecified.py_unspecifiedr   c   s@     BZF=-8"~,,, s   , 	88c                       e Zd ZdZdeiZd Zy)
TestModuleznetwork jinja testr   c                     | j                   S )N)test_map)selfs    r   testszTestModule.testsu   s    }}    N)__name__
__module____qualname____doc__r   r   r    r   r   r   r   p   s    |,Hr   r   N)r   
__future__r   r   r   Kansible_collections.ansible.utils.plugins.plugin_utils.base.ipaddress_utilsr   r   r   type__metaclass__r   EXAMPLESRETURNr   objectr   r   r   r   <module>r%      sZ    A @  "3j
 	 	 r   