ssh connection for the hosts in dynamic inventory

hello all,

i have dynamically generated inventory like below, i want to establish ssh conenction to all the ips for istiotst and coremediaprod servers. I have ssh keys configured in the .ssh folder:
when i run: ansible all -i inventory-ccp.ini -m ping
i get connection ‘success’ only for istiotest but not for coremediaprod.

can anyone please advise me on this.

[istiotest:vars]
ansible_connection = ‘~/.ssh/istiotest’
ansible_user = ‘user_name’

[coremediaprod:vars]
ansible_connection = ‘~/.ssh/coremediaprod’
ansible_user = ‘user_name’

[ccpclusternodes]
istiotest
master-group
user_name
10.32.142.184
10.32.142.185
10.32.142.186
worker
user_name
10.32.142.156
10.32.142.153
coremediaprod
master-group
user_name
10.32.31.166
10.32.31.165
10.32.31.167
node-group
user_name
10.32.31.170
10.32.31.168
10.32.31.169