I use serverspec for TDD for my Infrastructure. You don't need to install 
anything on the client. All of my clients run cents 6 minimal install. I 
run server spec from an ops server, on that server I installed ruby.

First I create all of the tests, then I create the plays to make the tests 
pass. Serverspec is very easy to use.
I also use the following enhancements so I can use my browser to easily see 
which tests passed/failed

https://github.com/vincentbernat/serverspec-example

This show me results formatted into red/green squares to quickly see where 
each test passed or failed.



On Friday, April 10, 2015 at 11:02:37 AM UTC-7, Sharan wrote:
>
> Hey all. Recently, I started using Ansible in one of my projects. And I 
> should say that, Ansible is easy to understand, get a firm grip and get 
> things rolling up easily. One thing that slowed me down was that, after I 
> write each and every task, I ensure that the task is doing its job in the 
> right way by going to the remote machine and verifying manually. I don't 
> know if that is a newbie's worry of not sure if that task is written 
> rightly! But, I felt that some kind of a test (for example TTD / BDD style) 
> would ensure that the playbook is helping me make my tests go from red to 
> green. To make it clear, I am not worried that the ansible modules are 
> erroneous. I know they are tested thoroughly before they get into the main 
> branch. My botheration is about whether the things I put together as a task 
> / play does things correctly.
>
> After doing some research, I also found that writing tests for 
> Infrastructure as Code is not a moot thing because even this is code. But 
> is there any BDD Testing framework that Ansible can be coupled with? Or 
> even in the first place, is it required? Am I doing a wrong practice of 
> checking the remote machine manually after running each task? 
>
> Any suggestions on the following are welcomed!
> 1. Best practice in developing infrastructure as code
> 2. How to test if the scripts are doing what they are intended to do
> 3. Any BDD framework available for the above purpose
>
> Thanks in advance.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6161adcc-61e5-4047-8311-35603eaa6319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to