Questions tagged [molecule]

Molecule is a Python package designed to aid in the development and testing of Ansible roles.

Molecule is a Python package designed to aid in the development and testing of Ansible roles. It includes support for multiple instances, operating system distributions, virtualization providers, and test frameworks.

It leverages Vagrant, Docker, and OpenStack to manage virtual machines/containers, with support for multiple Vagrant providers (currently VirtualBox, Parallels, VMware Fusion, and Libvirt). Molecule supports Serverspec, Testinfra, or Goss (beta) to run tests. Molecule uses an Ansible playbook (playbook.yml), to execute the role and its tests.

Find the source on Github and the documentation on the official website.

139 questions
1
vote
1 answer

Calling a role in another directory for molecule prepare step

I have role, role-1, I am trying to create molecule tests for, but this role is dependent on another role, role-2, located in a different directory. As part of the molecule setup of the docker container to run the tests in I have a prepare.yml file…
Dave
  • 244
  • 2
  • 16
1
vote
1 answer

Rdkit Mol object getProp("_Name") is empty. How to get ID?

So I have been looking through the documentation but couldn't find anything relevant. In the SDF file, Chembl name is empty but I do have entry on the chembl ID which I want. Here' 15 12 2 0 16 13 1 0 17 10 1 0 18 16 2 0 19 16 1 0 20…
A. Navid
  • 11
  • 2
  • 3
1
vote
0 answers

Molecule testing of a multi-playbook repo

We inherited a project with a large ansible code base of multiple playbooks and local roles. The current structure reassembles a fairly normal ansible layout. ansible playbooks a.yml b.yml c.yml d.yml templates files role …
user2403018
  • 297
  • 1
  • 4
  • 12
1
vote
0 answers

vagrant vm user as root in molecule

We in the middle to developed molecule testing using Vagrant as driver and libvirt as provider. However, the VM that Vagrant create from molecule use user 'vagrant' to perform validation or installation inside the VM. We plan to use 'root' user…
MrAZ
  • 394
  • 3
  • 13
1
vote
0 answers

How to define env variables for Docker driver during destroy step in molecule.yml

My CI pipeline fails at the final destroy stage of running molecule test because the default timeout for closing a Docker container is not big enough. Here is the error I get: msg: 'Error removing container…
1
vote
2 answers

Calculate descriptors with RDkit

I am trying to calculate all the descriptors (both 2D/3D) for a list of molecules with RDkit in python. When I run: MolecularDescriptorCalculator.CalcDescriptors(mol, simplelist) it returns: AttributeError: 'Mol' object has no attribute…
Giulia
  • 11
  • 1
  • 2
1
vote
2 answers

How can I define multiple instances in molecule which differ only in name?

I've got a molecule.yml which looks a bit like this: dependency: name: galaxy driver: name: docker platforms: - name: testohpc-compute-0 image: docker.io/pycontribs/centos:7 pre_build_image: true groups: - testohpc_compute …
lost
  • 2,210
  • 2
  • 20
  • 34
1
vote
0 answers

Running Systemd in Docker for Ubuntu 16.04, for Ubuntu 18.04 it works

for a molecule test I am trying to run the command "localectl status" in a role task. With the following settings in the molecule.yml it works for Ubuntu 18.04. but not for 16.04., in 16.04. the error "Failed to create bus connection: No such file…
NikNet
  • 45
  • 8
1
vote
1 answer

Molecule dependency in private gitlab

Is there any way how i can resolve dependencies from private project in gitlab? On my actual gitlab-ci i use such a trick requirements.tmpl: - name: my-company.ansible-init-disk scm: git src:…
1
vote
1 answer

How to test ansible playbook which involves changing OS parameter such as kernel , ulimit etc using molecule?

I'm trying ansible test my playbook using molecule package which involves changing kernel parameter. But docker won't support changing kernel parameter. How can I do testing in this case(using molecule & docker)?
Vishnu
  • 97
  • 1
  • 13
1
vote
1 answer

Time series data for water molecules from its dcd file

I am trying to make a file which contain time series data of water molecules from dcd file. Is it possible to generate this data using any of MDAnalysis module or function? Or is there any python script to generate this file? I need to generate this…
1
vote
1 answer

Is there any good examples for molecule roles that uses kvm? so far getting {'lint': ['must be of string type']} error

I've being trying to run find good repositories or examples of using molecule with kvm. But so far all of them gets this. {'lint': ['must be of string type']} I have no clue how to fix this. Like this --- dependency: name: galaxy driver: name:…
speedstern00b
  • 91
  • 2
  • 8
1
vote
0 answers

Passing information from prepare to converge and verify step

I use molecule for end-to-end testing ansible roles that interact with kubernetes clusters. Due to the fact that spinning up a kubernetes cluster (with additional features I need for my tests) to get a clean environment for each test is very time…
Timbo
  • 75
  • 8
1
vote
1 answer

Ansible error of var type when passing to my custom module

I'm looking to make an ansible role and module abled to list all packages on a Linux System actually installed and register them to a var. Then upgrade all of them and put the second list in an other var. My module is here to make a diff of the two…
1
vote
1 answer

Re-using existing ansible group_vars with molecule

I am working on adding tests to all my existing Ansible roles using Molecule. My existing Ansible playbooks utilize levels of variables like such: file: playbook_dir/group_vars/all contents: global variables, applicable to all everything (hosts,…
darkl0rd
  • 31
  • 1
  • 4