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

Flake8 in molecule3

after upgrading to molecule3 i've changed to new way of defining lints: lint: | yamllint -d "{ignore: env}" . ansible-lint flake8 It works for yamllint and ansible-lint, but it fails for flake8, in enters to console of flake8 and stays…
0
votes
1 answer

How do I SSH to molecule instance without molecule login

I'm using molecule and vagrant to deploy centos7 instance. For some reasons, I need to use ssh command access molecule instance, instead of molecule login. The ssh informations will then paste into one of my VS code…
Abel
  • 1,494
  • 3
  • 21
  • 32
0
votes
1 answer

How to debug your tests when using testinfra as verifier in Molecule

When testing an ansible role using molecule tool and verifying the result with testinfra(pytest), I am not able to print or debug certain output or an ansible variable. ============================= test session starts…
zegoat7
  • 457
  • 1
  • 6
  • 14
0
votes
0 answers

How to undo the changes after running ansible role inside a dedicated testing machine using Molecule

When using docker as a driver, Molecule is testing my Ansible role inside a container and then destroying it. But, my type of test is on the kernel level so I can not use Docker. I am using a dedicated testing machine. I would like to add a fallback…
zegoat7
  • 457
  • 1
  • 6
  • 14
0
votes
1 answer

Debian image - /sbin/init not found

I am trying to start a Debian image with the /sbin/init process for ansible role testing via molecule. Yes, I am aware, that one should not start /sbin/init in a container unless you really have a use case for doing so. With molecule I can test my…
ckaserer
  • 4,827
  • 3
  • 18
  • 33
0
votes
1 answer

molecule : how see “facts” about the machines under management like `ansible -m setup instance1`

I know for ansible, I can use ansible -m setup instance1 to see “facts” about the machines under management as per question: Where can I get a list of Ansible pre-defined variables? But I am using molecule so is there as way to same for my…
k1eran
  • 4,492
  • 8
  • 50
  • 73
0
votes
1 answer

How to run with molecule prepare.yml on one server but playbook on another?

I have one question, I will try to describe to you my problem, please check and tell me is that possible to do. I'm using molecule and DroneCI for automatic testing my playbooks. Because molecule doesn't have support for Proxmox natively, but…
Petar
  • 37
  • 9
0
votes
2 answers

Ansible Molecule pass multiple vault-ids

How do I pass multiple ansible vault-ids to molecule? Passing multiple vault-ids as options in molecule.yml will not work because the last vault-id entry will win. Example: provisioner: name: ansible options: vault-id:…
Dennis Hoer
  • 3,039
  • 2
  • 23
  • 34
0
votes
1 answer

How do I allow one molecule platform to fail testing?

During development of Ansible roles you may want to add support for a new platform. This process could require a big number of changes so is better to first enable this new platform and allow it to fail without changing the final result. How can I…
sorin
  • 161,544
  • 178
  • 535
  • 806
0
votes
1 answer

How does Molecule does the role lookup

Using Molecule 2.19.0 to test it on an Ansible role. Molecule and Ansible both work as desired. I've got a question regarding how molecule executes the Ansible role. This is my file structure: | my_role (Root of the role) * defaults * files *…
Kevin C
  • 4,851
  • 8
  • 30
  • 64
0
votes
1 answer

Circuit breaker config not working properly

I am setting up new molecular project and trying to config circuit breaker in my project under molecular.config.js and set windowOpen to 6 sec. But when i do any operation and throw an error. Circuit doesn't break down. I am not able to find any…
0
votes
1 answer

how can I run ansible molecule without colors?

When running molecule the logs display with colors: molecule lint -s preprod --> [36mValidating schema /home/singuliere/software/enough/infrastructure/molecule/letsencrypt-nginx/molecule.yml.[0m [0m[0m[0m[32mValidation completed…
singuliere
  • 767
  • 10
  • 19
0
votes
0 answers

Why is my Ansible copy command hanging unexpectedly?

I'm trying to implement an Ansible command to create or retain a logfile for an open source repo I'm contributing to: - name: Create (or retain) the {{ celery_application_name }} log file copy: content="" dest={{ celery_log_file }} …
YPCrumble
  • 26,610
  • 23
  • 107
  • 172
0
votes
2 answers

Failing to connect to localhost from inside a container Connection refused

I'm currently testing an Ansible role using Molecule. Basically, Molecule launches a container that is Ansible compliant and runs the role on it. In order to test the container, Molecule also embed unit tests using Testinfra. The python unit tests…
E. Jaep
  • 2,095
  • 1
  • 30
  • 56
0
votes
1 answer

test ansible roles with molecule and boto3

I have ansible roles that creates servers, S3 buckets, security groups ... and I want to establish some unit testing using Molecule. After some researches, I found out that Molecule is using Testinfra to run some assert commands on the remote/local…
Souad
  • 4,856
  • 15
  • 80
  • 140
1 2 3
9
10