meffie / molecule-proxmox

Molecule driver for Proxmox VE
MIT License
35 stars 9 forks source link

Molecule now requires plugins to perform schema validation (was: Error with molecule 4.0.2) #3

Closed asg1612 closed 8 months ago

asg1612 commented 1 year ago

I'm testing molecule-proxmox, with the molecule version 4. I created de role:

molecule init role --driver-name proxmox asg1612.proxmox

I try to run a test, and I get the error:

CRITICAL Failed to validate /home/informatica/Desarrollo/ansible-roles/proxmox/proxmox/molecule/default/molecule.yml

["'proxmox' is not one of ['azure', 'ec2', 'delegated', 'docker', 'containers', 'openstack', 'podman', 'vagrant', 'digitalocean', 'gce', 'libvirt', 'lxd']"]

My molecule.yml is the original from molecule init role command.

---
dependency:
  name: galaxy
driver:
  name: proxmox
platforms:
  - name: instance
provisioner:
  name: ansible
verifier:
  name: ansible
meffie commented 1 year ago

Hello,

How have you installed molecule-proxmox? Is it installed into a virtualenv? Is it a different virtualenv than is used to run molecule?

meffie commented 1 year ago

Oh, nevermind the questions. Testing with molecule 4.0.2 I see the same error. Checking now.

meffie commented 1 year ago

So, all third party driver plugins have been broken by molecule 4.0.2 due to the new schema validatation introduced in 4.0.2. This is been tracked on molecule issue https://github.com/ansible-community/molecule/issues/3689 (at least)

I'm not sure yet what we can do, other than downgrade to 4.0.1 until we have a fix from molecule.

meffie commented 1 year ago

Thank you for the report. As a workaround for now, I've pushed version 0.7.0 which just sets the required molecule version to 4.0.1 until I can fix the validation issue we are hitting with version 4.0.2.

asg1612 commented 1 year ago

Thank you very much for the reply.

I use poetry for install python packages.

Donwgrade to molecule 4.0.1 and use molecule-proxmox 0.7.0. It's works!!

Thanks

meffie commented 1 year ago

On Tue, 25 Oct 2022 01:18:40 -0700 Andrés Sánchez García @.***> wrote:

Thank you very much for the reply.

I use poetry for install python packages.

Donwgrade to molecule 4.0.1 and use molecule-proxmox 0.7.0. It's works!!

Thanks for the feedback, and again thanks for the report on 4.0.2.

This seems to be a very major change in Molecule for a patch release, which is unfortunate. I will be looking into what needs to be done to fix the schema validation. It seems possible to do for an open-source driver such as molecule-proxmox. It looks like private drivers are currently out of luck.

-- Michael Meffie @.***>

mhzawadi commented 1 year ago

Hello 👋🏼 Is this now fix in 4.0.4? if so could we get a new version please?

meffie commented 1 year ago

Hello 👋🏼 Is this now fix in 4.0.4? if so could we get a new version please?

Sorry, molecule broke the ability to have external plugins, and this was not fixed in 4.0.4. There have been changes since then, but as of 5.0 I do not believe it is possible yet to have external plugins without patches to Molecule. I have not been following upstream Molecule closely in recent weeks, so there may be something we can do to fix the scheme validation, but I've not had time to investigate this. It is a shame that Molecule broke the ability to have plugins at this time. Hopefully the situation will improve.

mhzawadi commented 1 year ago

Hey @meffie

As I use Proxmox so much, I have reverse engineered how molecule works and made a shell script drive it. Does me for now

meffie commented 1 year ago

According to

https://github.com/ansible-community/molecule/pull/3765

Molecule should have a way to let drivers specify their schema. I'll need to investigate, unless someone beats me to it. That was pushed way back in december of 2022, so things have likely changed since then.

meffie commented 1 year ago

Hey @meffie

As I use Proxmox so much, I have reverse engineered how molecule works and made a shell script drive it. Does me for now

Ok, thanks. We use Proxmox daily with Molecule version 4.0.1 (and this molecule-proxmox driver). Hopefully we will be able to solve the schema validation issues soon so we can use newer versions of Molecule.

meffie commented 1 year ago

Updated title to improve accuracy.

p3l1 commented 1 year ago

@mhzawadi As I use Proxmox so much, I have reverse engineered how molecule works and made a shell script drive it. Does me for now

Is there any chance you would share the shell script or any insights on how you accompished the workaround for proxmox?

Thanks!

@meffie I am currently figuring out what the next steps would be and could maybe work on a PR to get the provisioner working again, if this is possible without patches to molecule.

mhzawadi commented 1 year ago

I can, but its more then just a shell script. Also has some of my config it bits that would need removing

If you want me to tar up I can git it a try

p3l1 commented 1 year ago

@mhzawadi That would be great! Thanks!

mhzawadi commented 1 year ago

a starter for 10 is here -> https://github.com/mhzawadi/ansible-template, when I get time I will add roles and other stuff

p3l1 commented 1 year ago

a starter for 10 is here -> https://github.com/mhzawadi/ansible-template, when I get time I will add roles and other stuff

That is already very helpful, thank you for sharing this with us!

mhzawadi commented 10 months ago

Hello 👋🏼

Any update to this?

if not, I have been working on the tooling to get a drone-ci image built from the repo and test all my roles

now using the pve playbooks in the repo to build dynamic vms and then destroy them at the end of the run

varadinov commented 9 months ago

Any update on this? There is still a problem with new versions of molecule. I see the schema is allowing custom-* Have you evaluated this option to rename the driver name?

meffie commented 9 months ago

Sorry for the lack of progress here. This is still on my backlog, but I've started looking at Molecule v6.0.3. It is a shame the Molecule project broke out of tree drivers in version 4. That was really unfortunate. I've been using Molecule version 4 ever since, but I'd like to see if there is a way forward. I'll take a look as the "custom-*" driver naming. It looks like the Molecule project wants drivers to be centralized, so perhaps that should be the long term goal.

meffie commented 8 months ago

Hello, the new release 0.9.0 on pypi.org and the main branch here should address this issue. The driver name has been changed to molecule-proxmox which is a "custom" name for molecule, so it avoids the broken schema check. I'll look into adding a driver specific schema check later. Thanks to @varadinov for the suggestion.