How get all the containers of a pod

try to get all the containers that are included in a pod using ansible… I have no experience in ansible and kubernetes. It is the first I have worked with ansible and kubernetes

I use an iteration through the pods to get name’s of the containers that are include in a pod. I face two problems . The first is that when the script is called , I get an error that item is undefined . The second one is how I will get containers name, image version?

Below is the script