Hi Sean! Basically I view it should say changed when it affects the configuration or state of the remote machine, not if it needs to just run some commands.
I would concur that if it can't successfully affect a change, this is a case when it should be marked as a failure (fail_json). If the module is just returning "fact" type information, the usual convention would be to have it end in "_facts" and not return changed=True. So if the question is can a module never change anything, yes that's totally ok. Does this sort of answer the question? Let me know if not or if I am misunderstanding. Thanks! On Wed, Sep 3, 2014 at 3:14 PM, Sean Cavanaugh <[email protected]> wrote: > I have a module I am working on for our product the Cumulus OS where we > check routes and make logical decisions based on the result. > e.g. I make a config change to a node within my network and then check > another node in that network to make sure the path through the 'changed' > node is or is not taken. > > Working with a team mate here at Cumulus Networks the only time the module > can fail is when the command can't be run (improper output is retrieved, or > the command just goes fubar). I think it should fail whenever we don't get > a result we desire. I also think this particular module should never ever > say 'changed' since it is not changing any code on the network nodes > (debian boxes) at any time. It relies on other modules or playbooks to > make changes and then checks for what you desire with this module > (cl_prefix_check). Its just a 'checker' module that looks at the routing > table in various ways to simplify playbooks people will write. > > My question is this assumption correct: > Can a module never make something like 'changed=1'. I feel as changed > means a config (file) has been changed? > > (I know how to code this, but not sure if it follows ansible's idea of > changed/fail/ok, etc) > > > -S > > -- > 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/5967cfc8-2a8d-47c3-83fb-3901605128f9%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/5967cfc8-2a8d-47c3-83fb-3901605128f9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2BnsWgxok0ABmxgYK0iVzpA87bCh53%3D6%2Bf_jAf0%3DvyZozfDNrw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
