molecule icon indicating copy to clipboard operation
molecule copied to clipboard

RFE: Shared inventory directory

Open cidrblock opened this issue 2 years ago • 0 comments

As a user I want to specify the parent inventory directory for a scenario.

Molecule allows for this currently:

    provisioner:
      name: ansible
      inventory:
        links:
          hosts: ../../../inventory/hosts
          group_vars: ../../../inventory/group_vars/
          host_vars: ../../../inventory/host_vars/

it also sets MOLECULE_INVENTORY_FILE

Use cases:

  • Allow the user to specify a list of inventory locations that will override current molecule invetory logic and be apssed to the ansible-playbook command.
  • When using ansible as the provisioner, the invetory is constructed and would otherwise be put in the scneario specific inventory directory. This would allow for the sharing of an inventory between scenarios
  • Current use of seperate keywords (hosts/group_vars/host_vars) is confusing as ansible will resolve everything within an inventory directory if passed with -i

Related: #4000 would allow for a location to store a shared inventory.

cidrblock avatar Aug 12 '23 12:08 cidrblock