Open markfaine opened 1 year ago
It happened to me too yesterday when running molecule test. Sounds similar enough. I was running "molecule test" but had ANSIBLE_COLLECTIONS_PATH=../../.. in my environment which I find sometimes necessary. Not sure if this should be another issue. However, not much more to say about it.
I had the same problem today running molecule test
with my collection inside ANSIBLE_COLLECTIONS_PATH
. After that, there were two files in my collection named FILES.json
and MANIFEST.json
. All other files were gone.
I think this is caused by #3962. One user even commented that the changes in this pull request will cause problems.
I can't believe this is still a problem since 2023, even worse I fell into it again yesterday and lost all of the work I had not yet committed. Please someone fix this, or at least provide some sort of confirmation prompt before deleting all my work.
Prerequisites
pip check
does not report any conflictsEnvironment
molecule 6.0.2 using python 3.11 ansible:2.15.1 default:6.0.2 from molecule Linux wsl 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 GNU/Linux Ubuntu 22.04.2 LTS
What happened
Running molecule reset can delete the entire project. The role is in a collection and I think the issue is it tries to install the same collection from GitLab using ansible-galaxy, since my collections path is the same as my development path it overwrites my project. I've been using this same setup for years and this did not happen with previous versions of Molecule.
I am actively developing the collection so it is expected that I might need to run them. When I run them they need to be on the collections path.
If I edit my ansible.cfg and comment out the collections_path, it works correctly:
I could probably work around it by using a shell function or alias but I don't want to have to rely on a workaround.
Reproducing example
I've lost all of my uncommitted changes.