ansible/molecule

Unable to resolve dependency: No match for 'nokogiri (>= 0)' on this platform. Found: arm64-darwin

Opened this issue · 0 comments

Prerequisites

  • This was not already reported in the past (duplicate check)
  • It does reproduce it with code from main branch (latest unreleased version)
  • I include a minimal example for reproducing the bug
  • The bug is not trivial, as for those a direct pull-request is preferred
  • Running pip check does not report any conflicts
  • I was able to reproduce the issue on a different machine
  • The issue is not specific to any driver other than 'default' one

Environment

> molecule --version
molecule 24.12.1.dev4 using python 3.11
    ansible:2.17.1
    vagrant:23.5.3 from molecule_plugins
    azure:23.5.3 from molecule_plugins
    containers:23.5.3 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1
    podman:23.5.3 from molecule_plugins requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0
    default:24.12.1.dev4 from molecule
    ec2:23.5.3 from molecule_plugins
    openstack:23.5.3 from molecule_plugins requiring collections: openstack.cloud>=2.1.0
    docker:23.5.3 from molecule_plugins requiring collections: community.docker>=3.4.11 ansible.posix>=1.4.0
    gce:23.5.3 from molecule_plugins requiring collections: google.cloud>=1.0.2 community.crypto>=1.8.0
>

> sw_vers
ProductName:		macOS
ProductVersion:		15.2
BuildVersion:		24C101
>

> vagrant version
Installed Version: 2.4.3
Latest Version: 2.4.3

You're running an up-to-date version of Vagrant!
>

> vagrant plugin list
vagrant-parallels (2.4.2, global)
>

> pip check
No broken requirements found.
>

> uname -a                                                                                                                                                                                                                         
Darwin MacBook-Pro.localhost 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 19:02:41 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6030 arm64
>

What happened

When attempting to create a Vagrant box with the Parallels provider via Ansible Molecule, a dependency related error occurred:

TASK [Create molecule instance(s)] *********************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to validate generated Vagrantfile: b\"Vagrant failed to initialize at a very early stage:\\n\\nThe plugins failed to initialize correctly. This may be due to manual\\nmodifications made within the Vagrant home directory. Vagrant can\\nattempt to automatically correct this issue by running:\\n\\n  vagrant plugin repair\\n\\nIf Vagrant was recently updated, this error may be due to incompatible\\nversions of dependencies. To fix this problem please remove and re-install\\nall plugins. Vagrant can attempt to do this automatically by running:\\n\\n  vagrant plugin expunge --reinstall\\n\\nOr you may want to try updating the installed plugins to their latest\\nversions:\\n\\n  vagrant plugin update\\n\\nError message given during initialization: Unable to resolve dependency: No match for 'nokogiri (>= 0)' on this platform. Found: arm64-darwin\\n\""}

Yet the same Vagrant Provider can successfully create the same box without Ansible Molecule:

~/.ansible/roles/myexample > vagrant init bento/ubuntu-22.04-arm64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
~/.ansible/roles/myexample >

~/.ansible/roles/myexample > vagrant up --provider=parallels
Bringing machine 'default' up with 'parallels' provider...
==> default: Registering VM image from the base box 'bento/ubuntu-22.04-arm64'...
==> default: Creating new virtual machine as a linked clone of the box image...
==> default: Unregistering the box VM image...
==> default: Setting the default configuration for VM...
==> default: Checking if box 'bento/ubuntu-22.04-arm64' version '202401.31.0' is up to date...
==> default: Setting the name of the VM: myexample_default_1734628276367_21914
==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
==> default: Clearing any previously set network interfaces...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 10.211.55.38:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for Parallels Tools installed on the VM...
==> default: Parallels Tools installed on this VM are outdated! In most cases
==> default: this is fine but in rare cases it can cause things such as shared
==> default: folders to not work properly. If you see shared folder errors,
==> default: please update Parallels Tools within the virtual machine and
==> default: reload your VM.
==> default: Mounting shared folders...
    default: /Users/etepsic/.ansible/roles/myexample => /vagrant
~/.ansible/roles/myexample >

Reproducing example

driver:
  name: vagrant
  provider:
    name: parallels
platforms:
  - name: instance
    box: bento/ubuntu-22.04-arm64
    memory: 4096
    cpus: 2
provisioner:
  name: ansible