# Uanble to use/fetch ansible connection variables common for all

**URL:** <https://forum.ansible.com/t/uanble-to-use-fetch-ansible-connection-variables-common-for-all/42565>\
**Category:** Get Help\
**Created:** [May 9, 2025, 10:28am UTC](https://forum.ansible.com/t/uanble-to-use-fetch-ansible-connection-variables-common-for-all/42565 "2025-05-09T10:28:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Modak](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sameer_modak/32/5180_2.png) [@Sameer\_Modak](https://forum.ansible.com/u/Sameer_Modak)\
**Post date:** [May 9, 2025, 10:28am UTC](https://forum.ansible.com/t/uanble-to-use-fetch-ansible-connection-variables-common-for-all/42565/1 "2025-05-09T10:28:55Z")

</div>

# Below is our dir structure. Inside group\_vars/all.yaml and kafka1\_dev.yaml which has connection details but its not using/loading them. It still asking me the username. If i put single file which has hosts and vars it works. But if i separate the variables in group\_vars it does not. all: vars: ansible\_become: true vcc\_site: kafka1\_dev ansible\_connection: ssh ansible\_user: user

├── ansible.cfg  
├── inventory  
│. |  
│ ├── kafka1\_dev.yml  
│  
│ ├── group\_vars  
│ │ ├── all  
│ │ └── en1\_dev  
│  
├── playbooks  
│ ├── all.yml  
│ ├── fetch\_logs.yml  
│ ├── health\_check.yml  
│ ├── kafka\_broker.yml  
│ ├── kafka\_connect.yml  
│ ├── kafka\_rest.yml  
│ ├── kafka\_ui.yml  
│ ├── restart.yml  
│ ├── schema\_registry.yml  
│ ├── ssl\_certs.yml  
│ ├── tasks  
│ │ └── certificate\_authority.yml  
│ ├── troubleshooting  
│ ├── validate\_hosts.yml  
│ └── zookeeper.yml  
├── plugins  
│ ├── filter  
│ │ └── filters.py  
│ └── modules  
│ └── kafka\_connectors.py  
├── README  
│ ├── kafka\_broker  
│ │ ├── defaults  
│ │ │ └── main.yml  
│ │ ├── files  
│ │ │ ├── client.truststore.jks  
│ │ │ ├── server.keystore.jks  
│ │ │ ├── server.truststore.jks  
│ │ │ ├── client.truststore.jks  
│ │ │ ├── keystore.jks  
│ │ │ ├── kafka.server.truststore.jks  
│ │ │ └── og\_server.jks  
│ │ │ ├── kafka.client.truststore.jks  
│ │ │ ├── kafka.server.keystore.jks  
│ │ │ └── kafka.server.truststore.jks  
│ │ ├── handlers  
│ │ │ └── main.yml  
│ │ ├── meta  
│ │ │ └── main.yml  
│ │ ├── README.md  
│ │ ├── tasks  
│ │ │ ├── dynamic\_groups.yml  
│ │ │ ├── health\_check.yml  
│ │ │ ├── main.yml  
│ │ │ ├── restart\_and\_wait.yml  
│ │ │ ├── set\_principal.yml  
│ │ │ └── ssl\_certs.yml  
│ │ └── templates  
│ │ ├── client.properties.j2  
│ │ ├── kafka\_jolokia.properties.j2  
│ │ ├── kafka\_server\_jaas.conf.j2  
│ │ ├── kafka.client.truststore.jks  
│ │ ├── kafka.server.keystore.jks  
│ │ ├── kafka.server.truststore.jks  
│ │ ├── kafka.yml.j2  
│ │ ├── old\_gen\_certs  
│ │ │ ├── kafka.client.truststore.jks  
│ │ │ ├── kafka.server.keystore.jks  
│ │ │ └── kafka.server.truststore.jks  
│ │ ├── override.conf.j2  
│ │ ├── password.properties.j2  
│ │ ├── server.properties.j2  
│ │ └── zookeeper-tls-client.properties.j2  
│ └── zookeeper  
│ ├── defaults  
│ │ └── main.yml  
│ ├── files  
│ │ └── zookeeper.yml  
│ ├── handlers  
│ │ └── main.yml  
│ ├── meta  
│ │ └── main.yml  
│ ├── README.md  
│ ├── tasks  
│ │ ├── dynamic\_groups.yml  
│ │ ├── health\_check.yml  
│ │ ├── main.yml  
│ │ └── restart\_and\_wait.yml  
│ └── templates  
│ ├── myid.j2  
│ ├── override.conf.j2  
│ ├── zookeeper\_jaas.conf.j2  
│ ├── zookeeper\_jolokia.properties.j2  
│ ├── zookeeper\_log4j.properties.j2  
│ └── zookeeper.properties.j2

---

<div class="post-metadata">

**Author:** ![Lyle\_McKarns](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lyle_mckarns/32/8142_2.png) [@Lyle\_McKarns](https://forum.ansible.com/u/Lyle_McKarns)\
**Post date:** [May 9, 2025, 12:03pm UTC](https://forum.ansible.com/t/uanble-to-use-fetch-ansible-connection-variables-common-for-all/42565/2 "2025-05-09T12:03:02Z")

</div>

The tree you posted shows `kafka_dev1.yaml` in `inventories/` not `group_vars`. That doesn’t line up with the situation you sound like you’re describing.

---

<div class="post-metadata">

**Author:** ![Sameer\_Modak](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sameer_modak/32/5180_2.png) [@Sameer\_Modak](https://forum.ansible.com/u/Sameer_Modak)\
**Post date:** [May 19, 2025, 5:47am UTC](https://forum.ansible.com/t/uanble-to-use-fetch-ansible-connection-variables-common-for-all/42565/3 "2025-05-19T05:47:11Z")

</div>

@Lyle_McKarns : Do you suggest to move kafka1\_dev.yml inside group\_vars?? i have the same host inventory in group\_vars which is named as en1\_dev
