group_vars/all not working in awx

Hi guys,

Sorry I couldn’t find an answer to my question anywhere. I have a test playbook which runs from callback in AWX however the zabbix_agent role included in my playbook is not picking up any variables from group_vars/all. Should this work at all ? I cannot find this bit documented anywhere either.

Thank you for your help.

Regards,
TH

A simple step to help debugging:

Could you have a look at /api/v2/inventories/N/script/?hostvars=1 for the particular inventory you’re using? This is the inventory contents fed to ansible-playbook commands in AWX. Does this content contain the variables you expect?

Thanks,
Alan

Ignore my message. My playbook was running from playbooks/ directory and group_vars was in wrong location.

Yeah it was very weird error simply because it said the value is not defined but it also was set in the defaults for the role so it was even more confusing.

I will save that link for future :).

Thank you Alan!!

Hello Thorvald,

I have the same problem and I have tried all kinds of directory structures but AWX still can’t recognize my group_vars. I just moved recently from using Ansible directly to AWX. Running it in the terminal using Ansible works well though.
This is my current directory structure. Please advise how you structured yours. Thanks

├── ansible.cfg
├── deploy.sh
├── group_vars
│ ├── all.yml
│ ├── common.yml
│ ├── postgresql.yml
│ ├── test-hosts.yml

├── hosts
├── install-ansible.sh
├── Makefile
├── roles
│ ├── common
│ ├── deployer
│ ├── docker
│ ├── docker-registry
│ ├── dotnet-core
│ ├── elasticsearch
│ ├── fluentd
│ ├── geoserver
│ ├── java
│ ├── mongodb
│ ├── nginx
│ ├── nodejs
│ ├── pentaho
│ ├── postgresql
│ ├── rabbitmq
│ ├── repository
│ ├── tomcat
│ ├── web-portal
│ ├── zabbix-agent
│ └── zabbix-server
└── sites
├── deployer_var
├── deployer.yml
├── docker-registry.yml
├── docker.yml
├── etl.yml
├── fluentd.retry
├── fluentd.yml
├── postgresql.retry
├── postgresql_var
├── postgresql.yml
├── repository.yml
├── role-sh_var
├── role-sh.yml
├── web-portal.retry
├── web-portal_var
├── web-portal.yml
├── zabbix-agent.retry
├── zabbix-agent_var
├── zabbix-agent.yml
├── zabbix-server.retry
├── zabbix-server_var
└── zabbix-server.yml

You are most likely running into this problem: https://github.com/ansible/ansible/issues/30877

Which has been fixed and merged and we’ll pick it up when a new version of Ansible releases.