-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
molecule-driver-contrib: community managed drivers #1479
Comments
I am interested in this as well since I am working on making Molecule ready for Windows development (Hyper-V and WinRM support) since the shop I am working at is Windows orientated. If just the tickets get issued to the correct maintainer that should fix most of the problems (I think open for discussion of course). When a maintainer seems inactive over a longer period of time the driver should be removed from Molecule core. Edit: |
I am not sure if you are aware, but this is basically what is already happening. This ticket is about talking about other potential solutions because it seems this is not working for core devs (this may not be the case entirely but from the original motivating comment, I want to start this discussion in case that is so).
Each community driver maintains its own CI. This CI consists of: |
Maybe an option would be to handle drivers like Ansible handles module discovery. As an example you could have a custom driver in a "drivers" folder in the cwd and molecule could pick that up and could use the driver(s) in that directory. |
So you can more or less do this today with the 'delegated' driver. The delegated driver defaults to We have had users already use this for a vmware driver. Community members simply drop in 3rd party provisioning playbooks, and set the driver to delegated, and you should be good to go. |
The point with that approach is that the provisioning playbook resides with each role, whereas the drivers supplied with molecule keep the roles clean with only a molecule.yml. That was my main reason to update the LXD driver, I couldn't find a good workflow for custom playbooks within each role. Also it might be a good idea to create some delegated examples to keep people from reinventing the wheel if this is the preferred approach. |
This is true, but its also creating excess work when its not really necessary. We want a plugable way to add drivers, that exists today. |
Is it a possibility to do something like Ansible does with for example Azure (ansible[azure)]? This keeps the knowledge and drivers within Molecule but lightens the burden on the core maintainers. |
You know, I'd be down to just do this and leave it at that. However, there is one thing this doesn't cover, I think. In my Linode PR, I had to add an actual driver python module (see https://github.com/metacloud/molecule/pull/1458/files#diff-f31994c777cf7153ef405f9b02ab920a) which did some fiddling with the SSH password and instance name for connection details. This is not covered by the |
@lwm I believe you can set those bits in the delegated declaration (molecule.yml). I did consider using the delegated driver for mine originally but since my use case is company wide I thought it would be nicer to have it all in the main project if possible. |
I like the spirit of this discussion and can see both sides of the coin. We've got a boat load of Ansible roles and try very hard to leverage molecule for role development and automated CI with Jenkins. We're a mixed Linux/Windows shop and have to support both platforms. And, to make matters worse, we're a hybrid cloud shop using Azure and on-prem VMWare. To date, I've leveraged the delegated driver and we can spin molecule instances up/down on-prem in VMWare when we write/test roles that don't play well with Docker. The downside of this is that each role has these drivers in them and keeping consistency across the growing number of roles we have is a royal pain. Something pluggable would be cool, but I see how it could be difficult to support a wide variety of use cases. I've had success adapting the delegated driver to spin up/down VMs in Azure as well. My most difficult pain point at the moment is supporting Windows. I've got some Jenkins slaves with Virtualbox/Vagrant on them and built a Windows image with Packer, but the molecule vagrant driver with these Windows vbox images and the winrm stuff just isn't reliable enough. And then there's the whole verification piece that can be messy and without being able to RDP or access the Windows GUI it can be tough to visually check this stuff as well. I think I'd like to try the delegated driver spinning up Windows VMs in VMWare (or even Azure), but I can't figure out how to coerce Molecule to retain/use Ansible/WinRM stuff to connect to these things for converge/verify steps after they've been created (the create/destroy is the easy part). Essentially I need to adapt the following to store the WinRM bits, but I have no idea how to make Molecule make use of it once it is stored: - name: Populate instance config dict
set_fact:
instance_conf_dict: {
'instance': "{{ item.instance.hw_name }}",
'address': "{{ item.instance.ipv4 }}",
'user': "{{ molecule_yml.driver.ssh_user }}",
'port': "{{ molecule_yml.driver.ssh_port }}",
'identity_file': "{{ molecule_yml.driver.ssh_identity_file }}"
}
with_items: "{{ server.results }}"
register: instance_config_dict
when: server.changed | bool
- name: Convert instance config dict to a list
set_fact:
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
when: server.changed | bool
- name: Dump instance config
copy:
# NOTE(retr0h): Workaround for Ansible 2.2.
# https://github.com/ansible/ansible/issues/20885
content: "{{ instance_conf | to_json | from_json | molecule_to_yaml | molecule_header }}"
dest: "{{ molecule_instance_config }}"
when: server.changed | bool
- name: render ssh_config for instances
template:
src: 'ssh_config.j2'
dest: "/tmp/molecule-ssh-config"
when: server.changed | bool Once created, I'd like to be able to I feel like I'm close between my experiments with Vagrant and the delegated driver, but I can seem to put them together into something reliable. |
I think this is the same point as #1479 (comment)? If we could extend the delegated driver concept to allow for a driver python module as well, then it would be more useful. However, this still doesn't get away from the pain point that when you have 100+ roles and you 'eject' your delegated driver plays into them and then you want to make a change to them all ... #1479 (comment) is interesting! |
They can be shared. |
Right, so you could also submodule the delegated playbooks too. Perhaps not such a major issue. Should we also try to hook in a driver module there as well? |
The only issue I see with shared and delegated is that the knowledge stays with the user. Take for example @bandit145 who wants to use VMWare and starts building a solution. But there seem to be users having this working already as @retr0h states. This is time wasting and doesn't move the project forward. Might be an idea to keep the delegated setup but add examples in the docs and questions about these examples get assigned to the one who wrote and uses the example? I personally still don't see the issue with the solution proposed in #1479 (comment) |
I think it is a good idea to keep the delegated setup as a catch all and agree it might be a good idea to have a place for people to post their solutions so we're not all re-inventing the wheel. I certainly don't expect the molecule team to document every conceivable use-case as this delegated capability is very flexible but does come with some "gotchas" that aren't apparent to everybody. I finally put some cycles into my Jenkins/Molecule/Vagrant/VirtualBox/Windows (whew!) setup and got it working! |
Nobody said there was a problem with the issue, its just a matter of implementing it cleanly. I think we should create a table in the documentation that states the driver, the maintainer(s), and where the driver could be found (URL), for people to submodule or gilt it into the project. IMO, this solves the immediate problem. How do we feel about this? Seems like a good starting point. Suppose we do implement in #1479 (comment) we can list the pypi package instead of the git repo. |
This sounds great to me! 👏 👏 👏 |
Right, https://groups.google.com/forum/#!topic/molecule-users/O1a_YNAjy-Q probably solves this. |
Wow that is a hefty step! Hopefully the transition goes smooth and the project will continue to grow 🎉 |
Hi, I'm in the process of doing the technical move. Feel free to reach out in So hopefully this solved this issue |
🔥 |
Regarding #1473 (comment).
And since I am working on #1458, I am of course interested in this.
So, have you given any thought to a
molecule-driver-contrib
which is pluggable from the end-user side and introduces no maintenance burden on you all here? We could say that those drivers are maintained by the community and those community members are responsible for them. No guarantees are given back in molecule core. That would steer all the maintenance tickets away from here.I would guess core devs here would know the best way that is possible, if this is feasible.
I'd be happy to QA test any effort here in plugging in my Linode driver functionality.
The text was updated successfully, but these errors were encountered: