For what it's worth I tend to like the Testinfra project a bit more: http://testinfra.readthedocs.io/en/latest/
I try and follow the practice of "cattle not pets" as much as possible and with all of the infrastructure I manage in AWS don't have a use case for testing a set of servers that are long-lived. I do, though, make heavy use of Packer <https://www.packer.io/docs/> and Ansible for creating an image from which I'll deploy my VMs. I've used Serverspec before as a final provisioning step, started by a shell script and executing something like this to perform my tests cd tests/directory bundle exec rake spec Doing it that way ensures that my AMI is only created by Packer if all of my tests pass. That said, I think it's important to not duplicate your Ansible code just to have tests written in Serverspec or Testinfra. Ansible is purposely built to configure the desired state of your server/image. If all you want is to make sure a service is running and/or listening then re-run your Ansible playbook. If you're running these tests out-of-band from, say, Nagios or on a security team to validate the configuration of your image, checking whether a service is running with Serverspec or Testinfra makes sense. On Sunday, January 1, 2017 at 8:59:04 PM UTC-6, Dan Steffen wrote: > > Hello, > > I would like to use serverspec with ansible so I can test if the services > a running and listing, but I didn't find any informationen about how I can > use it, especially how I call the test in the playbook. > I would very thankful if someone can give me please some information about > the usage. > best regards > Dan > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/86e748a4-4418-4d2b-94a7-a5616eef0a6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
