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
0
votes
0 answers

Importing problem that need to be resolved

Good evening everyone, i am working on a molecule design project, and i chose mollstm model to predict new molecule from existing ones using smiles( entered as an input ) while taping this: from mol_lstm import MolLSTM, this error occurs: ERROR:…
0
votes
1 answer

Getting duplicate host callback error while running ansible molecule tests

I am getting "duplicate host callback" error while running molecule tests. Not sure what I am missing as configuration looks good logically and syntactically. Please help. Configuration: remi_repos: [ {name: remi, description: "REMI repository",…
Rob Wilkinson
  • 1,131
  • 5
  • 18
  • 34
0
votes
1 answer

Where does molecule set the path from when running tasks and handlers?

I have observed the following (in my opinion) extremely strange and seemingly inconsistent behaviour when developing molecule tests for an ansible role. My role (A) depends on another role, B. B runs a task that is also included as a handler (I am…
Simon Rose
  • 381
  • 5
  • 11
0
votes
0 answers

How do links work when using Docker provider for Molecule

How do I use links when using the Docker provider for Molecule tests platforms: - name: client image: ubuntu:focal groups: - robots exposed_ports: - 3022 published_ports: - 0.0.0.0:3022:3022/tcp networks: …
bearrito
  • 2,217
  • 1
  • 25
  • 36
0
votes
0 answers

Timeout waiting for privilege escalation prompt with Windows and molecule

I have to create some roles to windows hosts with Ansible. I would like to create them and test them with molecule framework. I have just a simple role to create a folder in windows 2019. - name: Create gogo1 directory win_shell: mkdir…
Lud
  • 45
  • 7
0
votes
1 answer

How come default vars are not visible to Ansible molecule Verify?

I have this a role with a defaults/main.yml which defines these vars: # Ansible deployment vars archive_audio_etc_dir: "/etc/archive/audio" archive_audio_log_dir: "/var/log/archive/audio" ... other stuff ... and this role has this tasks/main.yml -…
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
0
votes
0 answers

Ansible Molecule not working. ssh: Could not resolve hostname instance: nodename nor servname provided, or not known

I am new to using molecule and ansible. I am trying to follow this guide: https://molecule.readthedocs.io/en/latest/getting-started.html#getting-started-guide The problem I have is that when I run ... (venv) [red@mac-laptop.local fake_role]$…
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
0
votes
0 answers

ERROR! the role 'roles_snmp' was not found

I am setting up a pipeline to test ansible roles with molecule. When I run molecule test locally I see no issues. However, when I run the same in my Buildkite pipeline I see the following an error: [2022-11-03T17:07:07Z] ERROR! the role…
pl33gS
  • 31
  • 1
  • 6
0
votes
0 answers

Ansible role failed in molecule test

I'm trying to run molecule test on role. Role works good when I use it in playbook, but when i try to run 'molecule test' its failing as follows: TASK [meta_install_package : Install apt ['openssh-server']] ******************* fatal: [instance]:…
mkozub
  • 23
  • 2
0
votes
0 answers

How can I change the checked out commit of a git repository with Ansible?

As part of my Molecule test, I want to revert a previously created pyenv installation to an old state. The goal is to simulate a new Python version being released but not being available to pyenv because it hasn't been updated yet with git pull. The…
oschlueter
  • 2,596
  • 1
  • 23
  • 46
0
votes
1 answer

What is the recommended action for molecule lint

The internet normally recommends the following snippet to configure molecule lint: lint: | set -e yamllint . ansible-lint . Sometimes there is also an additional flake8. But Lets ignorethis for a while. I have two issues with that: First, the…
grafra
  • 411
  • 6
  • 16
0
votes
2 answers

Why does molecule lint use different rules than ansible-lint?

I am new to using molecule and want to enable molecule for my ansible content. This content is a folder containing three playbooks and a folder roles with 8 roles which are used in the playbooks. The playbooks run without problems. Now I wanted to…
grafra
  • 411
  • 6
  • 16
0
votes
0 answers

Ansible Molecule fails to create the docker instance

I am trying to get Molecule working with Docker on a Centos7 host. The 'molecule create' command fails to create docker instance, and gives error: 'Unsupported parameters for (community.docker.docker_container) module: ....' Checking with 'docker…
Joy
  • 1
  • 1
0
votes
1 answer

modifying python within molecule

I am using molecule to test ansible playbooks. The image i have has python2 with a symlink of /usr/bin/python -> /usr/bin/python2.7. In my prepare.yml, i have the following - name: Install python3 package package: name: …
0
votes
1 answer

ASK_PASS issue with molecule converge

I am using Centos 7 and I have little problem to solve. I suppose to run molecule converge and to be executed on Vagrant virtual machine. Problem i encountered was that "no tty present and no askpass program specified". I have tried to solve this…
Stigla7
  • 11
  • 3