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

Allowing mixing links and inventory variables #4026

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andycui66
Copy link

@andycui66 andycui66 commented Aug 25, 2023

We can use links to specify some default values for group_vars and host_vars. This PR gives user ability to override default values within molecule.yml file. This align with Ansible variable precedence convention.

Inspired by #3501 and fixes #2759

A few people need this feature including myself but original ticket was closed because issue opener found another solution. I am trying to pickup the work.

@gardar
Copy link
Contributor

gardar commented Feb 2, 2024

What's the status of this?

Will this result in the following variable precedence? (Ordered from least to greatest)

  1. provisioner['inventory']['links']['group_vars']['all']
  2. provisioner['inventory']['links']['group_vars']['groupname']
  3. provisioner['inventory']['group_vars']['all']
  4. provisioner['inventory']['group_vars']['groupname']
  5. provisioner['inventory']['links']['host_vars']['ansible_host']
  6. provisioner['inventory']['host_vars']['ansible_host']
  7. ...followed by normal ansible role/playbook precedence

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

Successfully merging this pull request may close these issues.

Cannot use "inventory.links.group_vars" together "inventory.host_vars"
2 participants