Like Ansible, molecule should load environment variable declared with MOLECULE_ prefix and and use them as default values for command line arguments.
At this moment to enable debug more, user needs to add --debug after molecule and before the commands. This may prove quite inconvenient as the CLI call could be in a file or even other ci repository.
By regonnizing MOLECULE_DEBUG=1 it would be much easier to trigger the debug mode without having to alter the source code and the entire build chain.
Hint: Ansible has quite a nice implementaiton regarding parsing environment variables and translating them directly into default values, avoiding the need to implement this feature for each command line option.
OK, MOLECULE_DEBUG is already being honoured.
See https://github.com/ansible/molecule/blob/master/molecule/config.py#L189.
I assume you already tried this and it didn't work, so, is it that it needs to be =True/False?
Hey @ssbarnea, I've played around with this with MOLECULE_DEBUG=1 and MOLECULE_DEBUG=True and it didn't work. So, this looks like a bug!
We need to be sure that we correctly recognize:
PS. I am not sure which should be the behavior when variable is defined but empty.
I've looked at the source and the root of the issue is that when merging os.environ with default hardcoded config default takes precedence over OS-provided env vars.