Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Continuous Testing with Molecule, Ansible, and GitHub Actions

117 views

Published on

The presentation uses an example and explanation from Chapter 13 in my book, Ansible for DevOps: https://www.ansiblefordevops.com

Make sure you never commit a broken playbook using Molecule, Ansible, and GitHub Actions. Jeff Geerling discusses his CI workflows using GitHub Actions to manage hundreds of Ansible-based projects, including playbooks, roles, collections, and even Kubernetes Operators. Learn how Molecule makes developing and testing Ansible content easier, and how you can integrate it with GitHub Actions—or any other CI environment—for easy Ansible CI.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Continuous Testing with Molecule, Ansible, and GitHub Actions

  1. 1. Continuous testing with Molecule, Ansible, and GitHub Actions Jeff Geerling (geerlingguy)
  2. 2. The earlier you catch defects, the cheaper they are to fix David Farley 2
  3. 3. Jeff Geerling (geerlingguy) • Ansible user since 2012 • Wrote a book: Ansible for DevOps • Writing another book: Ansible for Kubernetes • OSS maintainer: • 200+ projects • 27,000 stars • 14,000 forks `whoami` 3
  4. 4. 4 Molecule and GitHub Actions CI The example used in this presentation is based on an example in chapter 13 of Ansible for DevOps, which you can get at www.ansiblefordevops.com
  5. 5. (In Playbook directory) 1. Install Molecule: pip3 install molecule[docker] 2. Create a default scenario: molecule init scenario 3. Modify the scenario to run this playbook. Set up Molecule 6
  6. 6. molecule/default/molecule.yml
  7. 7. molecule/default/converge.yml
  8. 8. molecule/default/verify.yml
  9. 9. 11 GitHub Actions Integration
  10. 10. (In Playbook directory) 1. Create a GitHub 'workflows' directory: mkdir -p .github/workflows 2.Create a CI workflow: touch .github/workflows/ci.yml Set up GitHub Actions 12
  11. 11. 15 Complete Example is on GitHub Also includes example of testing on two different operating systems: https://github.com/geerlingguy/ansible-for-devops/tree/master/molecule
  12. 12. It's impossible to maintain many projects without good CI Jeff Geerling 16 #DevOpsHaiku
  13. 13. Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you youtube.com/user/RedHatVideos linkedin.com/company/Red-Hat facebook.com/ansibleautomation twitter.com/ansible

×