Skip to main content

Vagrant Molecule Plugin :: run molecule tests using Vagrant

Project description

PyPI Package https://zuul-ci.org/gated.svg Python Black Code Style Ansible Code of Conduct Ansible mailing lists Repository License

Molecule Vagrant is designed to allow use of Vagrant for provisioning of test resources.

Supported Platforms

This driver relies on vagrant command line which is known to be problematic to install on several platforms. We do our best to perform CI/CD testing on multiple platforms but some are disabled due to known bugs.

  • ✅ MacOS with VirtualBox - GitHub Actions

  • ✅ Fedora 32 with libvirt - Zuul

  • ✅ Ubuntu Bionic (18.04) with libvirt - Zuul

  • ❌ CentOS 8 with libvirt - Zuul DISABLED due to 1127 and 11020

Please do not file bugs for unsupported platforms. You are welcomed to create PRs that fix untested platform, as long they do not break existing ones.

Documentation

To use this plugin, you’ll need to set the driver and platform variables in your molecule.yml. Here’s a simple example using the fedora/32-cloud-base box:

driver:
  name: vagrant

platforms:
  - name: instance
    box: fedora/32-cloud-base
    memory: 512
    cpus: 1

Here’s a full example with the libvirt provider:

driver:
  name: vagrant
  provider:
    # Can be any supported provider (virtualbox, parallels, libvirt, etc)
    # Defaults to virtualbox
    name: libvirt
  # Run vagrant up with --provision.
  # Defaults to --no-provision)
  provision: no
  # vagrant-cachier configuration
  # Defaults to 'machine'
  # Any value different from 'machine' or 'box' will disable it
  cachier: machine
  # If set to false, set VAGRANT_NO_PARALLEL to '1'
  # Defaults to true
  parallel: true
  # vagrant box to use by default
  # Defaults to 'generic/alpine310'
  default_box: 'generic/alpine310'

platforms:
  - name: instance
    # List of dictionaries mapped to `config.vm.network`
    interfaces:
      # `network_name` is the required identifier, all other keys map to
      # arguments.
      - auto_config: true
        network_name: private_network
        type: dhcp
      - network_name: private_network
        ip: 192.168.123.3
      - network_name: forwarded_port
        guest: 80
        host: 8080
    # List of raw Vagrant `config` options
    instance_raw_config_args:
      # use single quotes to avoid YAML parsing as dict due to ':'
      - 'vm.synced_folder ".", "/vagrant", type: "rsync"'
      # Run 'uname' a provisionning step **needs 'provision: true' to work**
      - 'vm.provision :shell, inline: "uname"'
    # Dictionary of `config` options. Note that string values need to be
    # explicitly enclosed in quotes.
    config_options:
      ssh.keep_alive: yes
      ssh.remote_user: 'vagrant'
      synced_folder: true
    box: fedora/32-cloud-base
    box_version: 32.20200422.0
    box_url:
    memory: 512
    cpus: 1
    # Dictionary of options passed to the provider
    provider_options:
      video_type: 'vga'
    # List of raw provider options
    provider_raw_config_args:
      - cpuset = '1-4,^3,6'

More examples may be found in the molecule directory. They’re the scenarii used by the CI.

Get Involved

Authors

Molecule Vagrant Plugin was created by Sorin Sbarnea based on code from Molecule.

License

The MIT License.

The logo is licensed under the Creative Commons NoDerivatives 4.0 License.

If you have some other use in mind, contact us.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molecule-vagrant-1.0.0.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

molecule_vagrant-1.0.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file molecule-vagrant-1.0.0.tar.gz.

File metadata

  • Download URL: molecule-vagrant-1.0.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for molecule-vagrant-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fc1e988147226ada8288475b768c52a37366c8b50d30b91635cacfc64e1468c3
MD5 b2e1d6249bd2a9017571068ce0107d74
BLAKE2b-256 ae6c419f7aebe62d9cf523245c59a02dd79290f38408ac5a80e80fcd389863f8

See more details on using hashes here.

File details

Details for the file molecule_vagrant-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: molecule_vagrant-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for molecule_vagrant-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c58a3826b4665194a99d837da98039f3abb664482cd27565973bfd4f1f70bbb1
MD5 9570d619dba2769f4358695a63d576ec
BLAKE2b-256 6a0455afaf694bcd4e69713239be67bfcbdb2e5a114b03b490ba852d9dbb2580

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page