Ansible: extrating IP address from CIDR(192.168.21.x/24)

I have a variable name something like this defined in json format.

“zxc_address” : “192.168.21.x/24”

and i need to extract the IP address part(192.168.21.x) using ansible(yaml code) what is the simple solution for that? can it be done using ansible filters. if yes then how?

Thanks, VM

It's not well documented but the "ipaddr" filter, in 'ip' mode, just
returns the ip of a variable given to it:

ansible all -i localhost, -m debug -a "msg={{'192.168.21.1/24'|ipaddr('ip')}}"
localhost | SUCCESS => {
    "msg": "192.168.21.1",
    "verbose_always": true,
    "changed": false
}

It does a lot of really useful stuff, it's worth checking the existing
documentation: https://docs.ansible.com/playbooks_filters_ipaddr.html