Molecule - Testing Ansible code

Поділитися
Вставка
  • Опубліковано 11 вер 2024
  • How do you systematically test Ansible code? Using Molecule, what a great tool.
    The code for this video lives here: github.com/rob...

КОМЕНТАРІ • 4

  • @Oswee
    @Oswee 3 роки тому +3

    In mid-2021 i was hoping to find testing collection with molecule and not a stand alone role. But... still tnx for sharing. Also... everybody is using Docker and almost nobody talks about rootless, selinux and systemd caveats with that. Personally i am using KVM and Podman scenarios.

  • @MartinOstlund
    @MartinOstlund 7 місяців тому

    Any suggestions for actually writing tests to verify a role ? Trying to find some docs on this, but cannot seem to find any..

    • @yokanyore
      @yokanyore  7 місяців тому

      You can write tests in Ansible, using the file /molecule/default/verify.yml. These tests can include checking if ports are available, running commands, checking if files are placed, etc. Have a look at my roles at robertdebock.nl/

    • @MartinOstlund
      @MartinOstlund 7 місяців тому

      @@yokanyore Thank you. After browsing around in molecule/ on numerous github projects, I can't hardly find anyone actually doing it this way. The common use-case seems to be to write good roles and just use the Molecule framework for testing the roles on different Docker/Podman instances.