-
Notifications
You must be signed in to change notification settings - Fork 76
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
host_vars and group_vars in inventory directory are ignored by ansible-rulebook #681
Comments
Synchronizing the directories to the ansible playbook main directory solves the issue:
It there a better way? |
Hi @evonlanthen Thanks for the report.
I'm going to fix them in #683 |
Thanks for your investigation and your fix. Kind regards |
@evonlanthen When you ran the ansible-rulebook command line can you use the directory name for inventory without the file name e.g
|
If I specify the directory only, no hosts are found anymore. The same happens with:
|
@evonlanthen When a directory is set it should take the whole directory as inventory. This is what is going to fix: #684 |
Please confirm the following
Bug Summary
I have a simple ansible playbook which prints variables defined in host_vars and group_vars files defined in the inventory directory. If I execute the playbook with ansible-playbook (or ansible-runner), the tasks can be executed. If I trigger it by a webhook via ansible-rulebook the variables are not found.
Environment
OS: WSL2, Ubuntu 22.04.3 LTS
Ansible:
Ansible-rulebook:
Steps to reproduce
Directory structure:
playbook.yml:
rulebook.yml:
inventories/production/hosts.yml:
inventories/production/group_vars/mygroup.yml:
ansible-playbook command:
ansible-rulebook command:
webhook trigger:
ansible-rulebook output:
Actual results
Ansible-playbook run fails with undefined variable (it doesn't matter if a variable from group_vars or hosts_vars is used first).
Expected results
Successful ansible playbook run.
Additional information
No response
The text was updated successfully, but these errors were encountered: