Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group_vars and host_vars ignored when placed inside inventory folder (as per Ansible documentation) #15438

Open
6 of 11 tasks
hagaram opened this issue Aug 12, 2024 · 2 comments
Open
6 of 11 tasks

Comments

@hagaram
Copy link

hagaram commented Aug 12, 2024

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)

Bug Summary

When I create a job template, using some static inventory from repository (inventory --> add --> sync from source control), which is the same repository where also playbooks and group_vars/host_reside... the vars are ignored when the folders are placed inside invetory folder... unless I move them to playbooks folder.

I can't even, because my variables are encrypted with Ansible vault, but I'm unable to select vault secret for inventory sync job. (there asi already like a dozen issues reporting this, so I won't be creating new one for that).

How exactly does AWX work with variables/ Where does it read variables from ? I don't really need to import the variables to awx, as they are already in the repository.

AWX version

24.6.1

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

kubernetes

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

No response

Steps to reproduce

Run some playbook, with group_vars and host_vars being folders being inside the directory, where the static inventory is stored.

After moving the group_vars and host_vars to playbook directory, they are read properly - but this is something we don't want to do for various reasons.

Expected results

Ansible should read the variables.

Actual results

Ansible ignores the variables.

Additional information

No response

@hagaram
Copy link
Author

hagaram commented Sep 26, 2024

Anyone?

@robschm
Copy link

robschm commented Oct 16, 2024

I have exactly the same problem.
It only works, when the variables are inside the playbooks directory.

This is my directory structure:

inventory/
  group_vars/
    all/
       all.yml
  inventory
playbooks/
  test_group_vars.yml
ansible.cfg

If I put my inventory file and group_vars on root level it does not work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants