debug module: possible pull request

27 views
Skip to first unread message

Erik Anderson

unread,
Mar 13, 2014, 5:22:07 PM3/13/14
to ansible...@googlegroups.com
As currently implemented, if, in a moment of confusion, you pass in a variable directly instead of var=foo or msg=foo, the debug module's output is less than helpful.

For instance, if I run this against a host:

---
- hosts: all
  tasks:
  - debug: foo

...the debug module returns:

ok: [default] => {
    "msg": "Hello world!"
}

Is that the intended behavior? It seems as if it would be more helpful to, instead of printing "Hello world!", to raise an exception with a message that the user needs to specify var= or msg=.

If this change would be desirable, I'll submit a pull request for it.

-Erik

Michael DeHaan

unread,
Mar 13, 2014, 5:24:14 PM3/13/14
to ansible...@googlegroups.com
It's the way it's not very good.

Basically "Hello World" is the default "msg".

I would almost think that if there was no "=" in the line and the value was not a hash you could assume it was doing msg="<string value>" maybe?




--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADdM08r3Gxjyw0A94YTcbpKf90S5bdo0vepdQB8GYMEL9YA3cQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages