SandeepSpan
Cadet
Cadet
  • 2,540 Views

molecule usage for ansible development


Hi
I recently came to know about molecule which i am trying to use for ansible based automations that i am doing.

I tried looking for a topic related to molecule in this community but could not find one so thought of creating one.

Below are the points which i feel good have thoughts from this community,

1) is molecule to be used as a developement guideline framework for ansibled based automations?
2) i came to know molecule can work with various infra options like aws docker etc.
3) Will molecule tested and verified playbooks helps in onboarding those to ansible tower?

any other point that this community can contribute to understand pros and cons of molecule usage.
6 Replies
jlozadad
Mission Specialist
Mission Specialist
  • 2,521 Views

Re: molecule usage for ansible development

Hello,

I would say yes to all the questions. Molecule can be used to test all your roles in different infrastructure.

0 Kudos
Reply
Loading...
Anthony
Mission Specialist
Mission Specialist
  • 2,491 Views

Re: molecule usage for ansible development

Hello,

I also agree, currently I'm using molecule for testing roles before using them in production or putting them in Tower. 

0 Kudos
Reply
Loading...
bonnevil
Starfighter Starfighter
Starfighter
  • 2,444 Views

Re: molecule usage for ansible development

At AnsibleFest a couple of weeks ago, the presentation on the Ansible Galaxy ecosystem talked a lot about moving toward using molecule as part of the developer workflow.  Molecule would be used both to initialize roles, and then to test them (along with ansible-lint).  It's also expected that ansible-lint results will start getting applied as one content scoring factor on roles in Galaxy. I haven't worked with molecule much myself yet, though.

Galaxy had been allowed to coast for a little while, but apparently activity to improve it is heating up quite a bit.

0 Kudos
Reply
Loading...
oldbenko
Moderator
Moderator
  • 2,419 Views
Moved:

molecule usage for ansible development

0 Kudos
Reply
Loading...
DanK
Moderator
Moderator
  • 2,440 Views

Re: molecule usage for ansible development

In short - yes.  Molecule is a framework for testing ansible artifacts.  Both molecule and ansible-lint have been adopted by the ansible community.  I expect that in the coming months/year, there will be much better documentation, tradecraft, and integration of molecule/ansible-lint with regard to the ansible ecosystem.

In general, ansible playbooks and roles should be routinely tested, especially when changes are made to those artifacts.

Does that help? 

Reply
Loading...
bonnevil
Starfighter Starfighter
Starfighter
  • 2,434 Views

Re: molecule usage for ansible development

Jeff Geerling (geerlingguy), one of the more prolific role developers on Ansible Galaxy, has just started to use molecule for his projects.  He posted a blog entry in the last few days that I haven't had a chance to read through yet, that you might find relevant: https://www.jeffgeerling.com/blog/2018/testing-your-ansible-roles-molecule

Upstream Ansible Galaxy development is working on a possible replacement for the current ansible-galaxy tool, called mazer.  One of the design goals is to integrate that tool into a workflow that also includes molecule and ansible-lint for development and testing.  It's still very much a tech preview, though, and things could work out differently after they experiment with it for a while.  However, both molecule and ansible-lint are now part of the Ansible community project.

Molecule docs: https://molecule.readthedocs.io/en/latest/

Molecule GitHub repository: https://github.com/ansible/molecule

 

Tags (1)
Reply
Loading...
Join the discussion
You must log in to join this conversation.