Skip to main content

Molecule VMware Plugin :: run molecule tests on VMware

Project description

Molecule VMware Plugin

molecule-vmware-ci

Molecule VMware is designed to allow use of VMware vSphere environment for provisioning test resources.
Please note that this driver is currently in its early stage of development.

Installation and Usage

Install molecule-vmware and pre-requisites:

pip install molecule-vmware ansible pyvmomi

Please also install pywinrm if you want to use Windows in test instance.

pip install pywinrm

Create a new role with molecule using the vmware driver:

molecule init role <role_name> -d vmware

Configure <role_name>/molecule/default/molecule.yml with required parameters based on your vSphere environment.
A simple config is:

dependency:
  name: galaxy
driver:
  name: vmware
  vcenter_hostname: vcsa.local
  vcenter_username: administrator@vsphere.local
  vcenter_password: secret
  validate_certs: false
  datacenter: dc
  #esxi_hostname: change me to esxi hostname of deploying an instance. need it if not cluster specified
  cluster: cluster01
  folder: /vm/example
  vm_username: root
  vm_password: secret
  instance_os_type: linux # is possible only specify [linux or windows]
  # The below are possible parameters to be specified if using the windows template.
  #winrm_port: 5986 # is WinRM port
  #connection: winrm # is the connection type
  #winrm_transport: ntlm # is the authentication type
  #winrm_server_cert_validation: ignore # is the server certificate validation mode
  # The below list is possible to define DNS nameservers
  #dns_servers:
  #  - "8.8.8.8"
  #  - "8.8.4.4"
platforms:
  - name: instance1
    template: CentOS7
    hardware:
      num_cpus: 2
      memory_mb: 2048
    networks:
      - name: VM Network
        type: dhcp
  - name: instance2
    template: CentOS8
    snapshot_src: linked_clone # is a snapshot name to be possible specified if you want to use linked clone.
    resource_pool: rpool # is a resource pool to be possible specified
    hardware:
      num_cpus: 2
      memory_mb: 2048
    networks:
      - name: VM Network
        ip: 100.64.0.2
        netmask: 255.255.255.0
        gateway: 100.64.0.1
    # The below are possible parameters to be specified if using the windows template.
    #customization:
    #  fullname: molecule # is the server owner name
    #  orgname: molecule # is the organization name
provisioner:
  name: ansible
verifier:
  name: ansible

Template requirements

A template requires vmware tools because it is done Sysprep or Linuxprep to initialize OS.
When Linux, please also install Perl to the template.

License

The MIT License.

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-vmware-0.3.6.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

molecule_vmware-0.3.6-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

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