molecule icon indicating copy to clipboard operation
molecule copied to clipboard

molecule fails to reset itself when driver is changed in config

Open ssbarnea opened this issue 4 years ago • 2 comments

I observed that molecule gets confused when a driver is swithced inside a scenario, like moving from delegated to docker casing confusing errors that do not give a hint about what caused them.

--> Action: 'destroy'
ERROR! the playbook: None could not be found

An error occurred during the test sequence action: 'destroy'. Cleaning up.
ERROR:
--> Scenario: 'foo'
--> Action: 'cleanup'
Skipping, cleanup playbook not configured.
--> Scenario: 'foo'
--> Action: 'destroy'
ERROR! the playbook: None could not be found

Funny part is that this scenario is not supposed to have these playbooks.

Removing temp files of molecule does solve the issue, but most users do not even know where these are located.

I am not yet sure how we can decide when we are in a tainted environment and to suggest performing a reset as we do want to do it by accident. Maybe timestamping molecule.yml file would be enough? When this is changed we can throw a clearly visible warning which tells user that config was tainted since last run and that they may want to do a reset if somethign fails.

ssbarnea avatar Feb 07 '20 11:02 ssbarnea

Thanks @ssbarnea, removed temporal files (in my case ~/.cache/molecule/) as workaround and everything ok.

Daniel-Sanchez-Fabregas avatar Feb 10 '20 11:02 Daniel-Sanchez-Fabregas

There is now the molecule reset command that can do this but is not run automatically.

If anyone wants to implement this it would be really nice first feature.

ssbarnea avatar Feb 20 '20 17:02 ssbarnea