molecule icon indicating copy to clipboard operation
molecule copied to clipboard

Allowing mixing links and inventory variables

Open andycui66 opened this issue 2 years ago • 1 comments

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 https://github.com/ansible/molecule/pull/3501 and fixes https://github.com/ansible/molecule/issues/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.

andycui66 avatar Aug 25 '23 21:08 andycui66

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

gardar avatar Feb 02 '24 14:02 gardar