How to develop and use custom drivers for Molecule? #313
Unanswered
DimaZzZz101
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm currently getting into developing custom Molecule drivers, specifically a driver for VMware (in the style of the existing
azure
ordocker
drivers), and I have a few questions and observations I’d love some input on.1. How are custom Molecule drivers supposed to be developed?
I've studied the
molecule-plugins
repository and tried to follow the existing driver patterns (azure
,docker
, etc.), including:molecule.driver
cookiecutter
directory with scenario templatessrc/
However, documentation around how to write and test your own custom driver from scratch seems sparse. Is there any maintained guide or best practices available for developing 3rd-party drivers in the Molecule 6 ecosystem?
2. Scenario templates from the driver aren't used — why?
Here’s the confusing part.
When I run:
I expect the scenario directory
molecule/test_azure/
to contain the driver’s custom scenario templates — as defined in the driver'scookiecutter/{{cookiecutter.molecule_directory}}/...
files.Instead, I get the default Molecule templates, as if the driver was ignored for this part.
Interestingly:
I found some commits and changelog entries mentioning changes to plugin handling, including possible temporary removal and re-introduction of this functionality. So I'm wondering:
3. Am I doing something wrong?
I’m just getting started with Molecule, and it surprises me that no one else seems to report this. Either I missed something obvious in setup or the community has moved on from this usage pattern?
Any help, context, or updated pointers on how to develop and distribute a custom driver (including how scenario templates should be used in v6.x) would be greatly appreciated!
Thanks in advance!
—
P.S.1 If needed, I can share my plugin layout or repro steps.
*P.S.2 This text is auto translated (sorry if something wrong)
(.venv) dimazzzz@dz-test:~$ adt --version
(.venv) dimazzzz@dz-test:~$ molecule drivers
(.venv) dimazzzz@dz-test:~$ tree molecule_molecule_vmware/
(.venv) dimazzzz@dz-test:~$ molecule init scenario test_default
(.venv) dimazzzz@dz-test:~$ molecule init scenario -d docker test_docker
(.venv) dimazzzz@dz-test:~$ molecule init scenario -d azure test_azure
(.venv) dimazzzz@dz-test:~$ tree molecule
(.venv) dimazzzz@dz-test:~$ cat molecule/test_default/molecule.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_default/converge.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_default/create.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_default/destroy.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_docker/molecule.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_docker/converge.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_azure/molecule.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_azure/converge.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_azure/create.yml
(.venv) dimazzzz@dz-test:~$ cat molecule/test_azure/destroy.yml
Beta Was this translation helpful? Give feedback.
All reactions