Continuous Testing with Molecule, Ansible, and GitHub Actions

Поделиться
HTML-код
  • Опубликовано: 12 окт 2020
  • This presentation was given at AnsibleFest Global 2020.
    The presentation uses an example and explanation from Chapter 13 in my book, Ansible for DevOps: www.ansiblefordevops.com
    I am uploading it to the RUclips channel since the platform where the session is stored is not all that easy to access after the fact. Here's the description from my session:
    "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."
    #AnsibleFest #Ansible #Molecule
  • НаукаНаука

Комментарии • 40

  • @kylewalker2949
    @kylewalker2949 3 года назад +1

    Awesome and thorough as always! Thanks for all you do Jeff!

  • @charlesshaw9808
    @charlesshaw9808 3 года назад +4

    Watched this live and watching again 😀

  • @LorenzoBettini
    @LorenzoBettini 2 года назад

    Thank you for this great presentation of rare quality and clarity! And thanks for your book! :)

  • @markberry5994
    @markberry5994 3 года назад +1

    Thanks for making this available. It wasn't available after the live session and I was told that on demand won't be up until after the conference ends. And then it will only be available for a year.
    Great session.

    • @jeremys6003
      @jeremys6003 3 года назад

      they are usually available minutes after the presentation is over. I see it there now.

    • @markberry5994
      @markberry5994 3 года назад

      @@jeremys6003 yeah, they did appear after a short time. Support gave incorrect info. I find the service they are using a bit janky.

    • @jeremys6003
      @jeremys6003 3 года назад

      @@markberry5994 Agreed but I did just learn the sessions will stay online for 12 months.

  • @DracStarDrac
    @DracStarDrac 3 года назад +1

    Great tutorial sir, and this comes right after almost all sessions of Ansible Fest , did saw you there

  • @kenmurphy4259
    @kenmurphy4259 3 года назад

    Awesome demo and explanation of Molecule. I need to port this over to a Network Automation scenario

  • @RobertoPazAr
    @RobertoPazAr 3 года назад

    Great video. Very clear as usual.

  • @NewAgeDIY
    @NewAgeDIY 3 года назад

    As someone that hasn’t got a clue on what your talking about I find myself learning more on each subject you review.
    Jeff your so far a head of me that your words are zipping past me at the speed of light.
    It’s as though I have found a book written by a alien race. Very interesting to look at but I haven’t figured out if I have it up side down or right side up. 👇🏽👆🏾

  • @antogx1
    @antogx1 Год назад

    awesome content

  • @JohnMitchellCalif
    @JohnMitchellCalif 3 года назад

    thanks so much! Your talk is super-clear and useful as always.
    I'm producing a screencast very similar to this one, where I'm developing a *Terraform* script using Molecule. M/Ansible is super useful and flexible, I hope that the combination with TF is a "best of both worlds" thing vs a "brain explody" thing :)

    • @JeffGeerling
      @JeffGeerling  3 года назад

      I haven't personally used Terraform with Molecule, but it seems doable! I know a lot of people use Ansible + Terraform.

  • @mallikbm3990
    @mallikbm3990 2 года назад

    Thanks Jeff for such a great presentation. Can this be used to test any codebase not just limited to Ansible roles?

  • @Fireflierification
    @Fireflierification 3 года назад

    Nice video! I am only just getting into this and it can get rather confusing with all options one has. Do you ever use Jenkins for any sorts of purposes in relation to Ansible or does this fulfill your needs?

  • @Maeltht
    @Maeltht 3 года назад

    Great Great Tutorial. What is the best way to convert this? I would like to use molecule-ec2 with gitlab-ci

  • @_XY_
    @_XY_ 2 года назад

    👏👏

  • @_XY_
    @_XY_ 2 года назад

    Green checkmark good ✅✅

  • @mayurchavhan8590
    @mayurchavhan8590 3 года назад

    Lot of Actions ehhh, Keep on coming...

  • @kaivalyashah
    @kaivalyashah 3 года назад +1

    What is the advantage of running daily/monthly tests if you are already testing on every PR and push?

    • @JeffGeerling
      @JeffGeerling  3 года назад +2

      For many projects, there are days or weeks where nobody is actively working on them, so the regular CI runs can catch things like bitrot (compatibility with newer versions of Ansible, ansible-test, etc.

  • @AlexWillmer
    @AlexWillmer 3 года назад +1

    Introductions finish at time index 5:40

  • @1988marksie
    @1988marksie 3 года назад +4

    Why not run the linting in actions rather than molecule? That way it only runs once rather than once per os/playbook test on molecule.

    • @JeffGeerling
      @JeffGeerling  3 года назад +3

      That's not a bad idea. I still like having the ability to run `molecule lint` though, locally, and having Molecule do that work for me. The lint step only takes 3-5 seconds, but it would shave a little time if I just had a separate job that only did the lint, and the other jobs just ran the molecule test scenario without needing to have ansible-lint and yamllint installed (though they install pretty quick).

    • @chrisjsewell
      @chrisjsewell 3 года назад

      It’s funny you should say this, on github.com/marvel-nccr I am just in the process of updating our roles testing from travis to GH Actions.
      In this I have also moved the linting from molecule to pre-commit, with the added bonus of using yaml-pretty-format to remove some of the manual work.
      This gist is essentially what I’m adding: gist.github.com/chrisjsewell/c8b4465e1bc006f483d9313d3a33eff4

    • @chrisjsewell
      @chrisjsewell 3 года назад

      There is also adds continuous deployment added 😀 But it would be great if ansible-galaxy had more focussed support for this, as they have with the TravisCI webhook

  • @minecraftchest1
    @minecraftchest1 2 года назад

    I would like to see you use Gitlab CI.

  • @AnatoliyPedchenko
    @AnatoliyPedchenko 3 года назад +1

    I don't understand the use of `- import_playbook: ../../main.yml`. Why not just use something like
    - name: Converge
    hosts: all
    roles:
    - role: my_role

    • @LKamii
      @LKamii 3 года назад +2

      This is to test a playbook. Sometimes you want to test playbooks with multiple roles or just simple playbooks not utilizing roles.

  • @roberthealey7238
    @roberthealey7238 7 месяцев назад

    Would you considered an update on using molecule? There have been a lot of changes recently…

    • @roberthealey7238
      @roberthealey7238 7 месяцев назад

      Most notably/irritating is the removal of the lint command from molecule. 😠

  • @omaralikhan4633
    @omaralikhan4633 3 года назад

    excuseme, what is your $PS1?

  • @RavianXReaver
    @RavianXReaver 3 года назад +1

    Faster than Sonic

    • @JeffGeerling
      @JeffGeerling  3 года назад +2

      SEGAAAAAAAAAAA

    • @RavianXReaver
      @RavianXReaver 3 года назад

      @@JeffGeerling I was really hoping to join today but couldn't keep track of time :( but tomorrow is another day!

  • @alexalexl245
    @alexalexl245 3 года назад

    Hello Jeremy! Please help me how to deploy jenkins server with Ansible, your role in ansible-galaxy don't work :((

  • @webarchitect
    @webarchitect 3 года назад +1

    There's a problem I have on testing ansible role while in development. I can see that you always require role itself by it's name in `converge.yml` in almost all your `ansible-role-*` repos, and it causes INSTALLATION OF THE STABLE VERSION FROM GALAXY. But I don't think this is a good idea! How do you test changes then? I mean, how can you test a branch or PR then?
    I believe that the best practice should be make `converge.yml` use only current state of the code of the role, where it is. Doing this way you can even run `molecule test` locally before committing and pushing anything.
    And I also found that it should be something like
    ```
    tasks:
    - name: "Include this role"
    include_role:
    name: "ansible-role-myrole"
    ```
    And this is how it's generated by `molecule init role`. So there are two questions I have:
    1. Is there any more nice way to do the same without specifying name "ansible-role-myrole"?
    2. Why don't you use this in your repos?
    Thank you! :)

    • @webarchitect
      @webarchitect 3 года назад

      I got it! You intentionally create the working directory "geerlingguy.php", so the `roles: geerlingguy.php` doesn't go to the galaxy! That's a tricky!