Closed ollie1 closed 2 years ago
@ollie1
You are right. It's just a schema issue.
It should be a dict, and could you help submit a PR to fix it?
I can help review it.
Reference:
@zhan9san See the linked PR. Tested on a personal role which was failing that validation.
Edit: had to fix the tox -e lint
corresponding test too.
The current definition at least used with several vars, e.g.
env:
- Hello: World!
- Wa: Zaaaa!
fails the create sequence with the docker driver anyway with the following error
"argument 'env' is of type <class 'list'> and we were unable to convert to dict: <class 'list'> cannot be converted to a dict"
For the records: I tested (as allowed by many ansible environment related settings)
env:
- toto=1
- pipo=2
which was not supported by docker driver either with the same error as above
Issue Type
Molecule and Ansible details
Molecule installation method (one of):
Ansible installation method (one of):
Detail any linters or test runners used:
Desired Behavior
Molecule 4.0.2 should work with the same molecule.yml as 4.0.1
Actual Behaviour
To reproduce, generate a standard molecule role as follows:
Modify molecule.yml to add env as follows
Run
molecule create
, and observe that an error is shown.In molecule 4.0.1, this works as expected. In 4.0.2 this behaviour has broken, and we must change the env keys in our molecule.yml to an array. If this is intentional, it's a breaking change and it should be mentioned it in the release note - hopefully it's just a bug caused by the json schema changes.