molecule icon indicating copy to clipboard operation
molecule copied to clipboard

Document `--base-config` and `env-file` + add new project local defaults

Open ssbarnea opened this issue 5 years ago • 6 comments

Current base configuration is fully undocumented. The page that is most likely to describe it contain nothing https://molecule.readthedocs.io/en/latest/configuration.html and neither other page of the documentation.

We not only need to document this but also make molecule load its base configuration automatically by discovering it from the code repository.

For local development is ok to keep configuration in a ~/.config but any colaborative project would expect to have a git hosted base config file that would be found and used when molecule is run.

ssbarnea avatar Mar 16 '19 09:03 ssbarnea

Asked for in https://github.com/ansible/molecule/issues/1423#issuecomment-474963763 as well :+1:

decentral1se avatar Mar 20 '19 18:03 decentral1se

Good there is already ticket for this! +1 for the documentation. Trying to try/error how it works.

Please document also --env-file option.

tace avatar Mar 20 '19 19:03 tace

Right, we have auto-loading already:

  • https://github.com/ansible/molecule/blob/master/molecule/config.py#L312
  • https://github.com/ansible/molecule/blob/master/molecule/config.py#L514

I'd like to suggest then to close this off that we provide new default paths:

  • ${MOLECULE_PROJECT_DIRECTORY}/.molecule/molecule.yml # base-config
  • ${MOLECULE_PROJECT_DIRECTORY}/.molecule/env.yml # env-file

We document this and keep loading from the existing defaults to not break anyones use case.

Thoughts?

decentral1se avatar Apr 04 '19 10:04 decentral1se

Is there a default env.yml path already, or is this a proposed change?

WithoutAnAce avatar Jun 05 '19 17:06 WithoutAnAce

Yeah, molecule --base-config .config/molecule/config.yml converge -s dev -- --limit workstations --tags nushell --list-tasks is a little bit verbose. I would like to drop base-config and scenario flags when iterating on some constant setup. But definitely "nice-to-have" thing.

dzintars avatar Nov 27 '22 22:11 dzintars

Similar issue https://github.com/ansible-community/molecule/issues/1664

dzintars avatar Feb 02 '23 21:02 dzintars