Exactly, Ansible playbooks are declarative. I would disagree that it's like writing code for the most part, it was designed to be very far from that, but there are definitely steps involved that happen in order.
You are meant to read the playbook and we made them very auditable for this reason. Of course, monitoring is a very very good idea. An example of this is what if a playbook does something you don't have a test for, but you still don't want... you can only get that by reading the playbook, which is why it's designed to be so easy to read and follow changes in source control diffs. I don't think you need to write a test to say "foo is installed" as the Ansible module enforces that. You do want to test that your web service is running ok, and not just at deploy time, but also in your monitoring. On Wed, Dec 11, 2013 at 3:39 PM, Patrick Regan < patrick.rubbs.re...@gmail.com> wrote: > I guess my trouble of understanding is how would this test be different > than just the play itself. I'm not exactly an expert so forgive me, but > given that plays are written in a declarative "This is what I want" style, > wouldn't the tests essentially be saying exactly the same? > > In other words why have more granularity than "start apache; test port 80" > which can be done with existing modules? Or am I missing this whole > conversation altogether? > > > On Wed, Dec 11, 2013 at 3:30 PM, Aaron Hunter <aaron.hunt...@gmail.com>wrote: > >> I should clarify a bit because it looks like I have given you the wrong >> impression. I have confidence that the Ansible modules behave as >> advertised. My experience with them to date has been excellent. The Ansible >> code is not what I'm trying to test. >> >> What I want to test is that the *administrator *has used Ansible to >> configure a system in a way that meets the spec. In other words, I want to >> test that the admin has written a *correct *Ansible script. Writing an >> Ansible playbook is like writing code. When you write code you have to test >> it externally. I intend exactly what Michael wrote above: testing outcome >> not implementation. If I don't test the results of the playbook, how do I >> know the admin wrote the correct script? >> >> --Aaron >> >> >> >> On Wednesday, December 11, 2013 2:39:34 PM UTC-5, Brian Coca wrote: >>> >>> FYI, there are quite a few unit test already that verify that 'the file >>> module' works as advertised, you can run 'make tests' in an ansible >>> checkout to get them. There should be no need to do this per playbook. >>> >>> not all modules or cases are covered but if you want to add tests at >>> this level I suggest looking into the 'test' dir in the ansible checkout. >>> >>> Do you tests all core java libraries when you deploy a war to tomcat? >>> >> -- >> 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. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > -- Michael DeHaan <mich...@ansibleworks.com> CTO, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- 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. For more options, visit https://groups.google.com/groups/opt_out.