question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"molecule.yml as only config required" support for plugins (molecule-hetznercloud)

See original GitHub issue

Issue Type

  • Feature request

Molecule and Ansible details

  • Latest

Molecule installation method (one of):

  • pip

Ansible installation method (one of):

  • pip

Desired Behavior

I’m migrating a lot of roles to Molecule 3.0 and it’s quite a piece of work. That’s fine and I’m glad to be able to do it. However, it got me thinking, it would be excellent if I only had to migrate my molecule.yml and not the prepare/create/destroy etc. (there were changes in the plugin implementation).

I have no custom changes to the create/destroy/prepare yaml files whatsoever. I feel like I don’t need to see them in the molecule/default/ folder. If they weren’t there, then I really wouldn’t notice and I would have a lot less work to do.

This would upstream maintenance work into the plugin (for create/prepare/destroy/etc.) and make migration much easier (allowing more flexibility in the molecule.yml definitions because you only have to change one file now).

So, my request is, can we make it such that if you have no create.yml in your molecule/default folder, then molecule looks at your driver plugin and then does a lookup into the plugin directory path to run the default create/prepare/destroy/etc. You can always override.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ssbarneacommented, Apr 26, 2020

I do not remember how I implemented it, you need to dig a bit. Still, I would fully support an implementation that makes this default for all plugins. Maybe they could override it in the future, but I see no harm to assume it default.

I think there are few plugins that do not use playbooks for create/destroy, probably these are more problematic as you still want to call their internal implementation.

0reactions
decentral1secommented, Apr 27, 2020

Ok, I just had to add a “playbooks” dir to my plugin implementation and bundle there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration — Molecule Documentation
The Config object instantiates Dependency, Driver, Lint, Platforms, Provisioner, Verifier, Scenario, and State references. Initialize a new config class and ...
Read more >
How to test Ansible playbook/role using Molecules with Docker
Molecule only support Ansible 2.2 or latest version ... then it reads it's main configuration file “molecule.yml” inside molecule directory.
Read more >
How To Test Ansible Roles with Molecule on Ubuntu 16.04
Step 4 — Modifying the Role for Running Tests. In our case, configuring Molecule involves modifying the Molecule configuration file molecule.yml ...
Read more >
Molecule Documentation - Release 2.13.1 AUTHORS.rst
6.11.2 Why does Molecule only support Ansible versions 2.2 and later? ... To start a service which requires systemd, configure molecule.yml ...
Read more >
Test Ansible Roles using Molecule and Podman
The Challenge: Lightweight and easy testing I needed to have testing added to Ansible roles. There are various people in the customer ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found