Dan Ford
Dan Ford

Reputation: 224

Ansible silently skipping tasks/debug

I'm not an Ansible newbie, but I'm beginning to feel like one. I've written a custom module, something I've done before, and am trying to use it in a set of playbooks I'm developing for an application outside of my regular Ansible use (an important point).

When I run a playbook that includes a task that uses the custom module, the task is silently "ignored." Meaning, there is no output at all, they're not "skipped" and they do not cause an error, nothing. I've turned up verbosity and can see Ansible processing other modules from tasks in the same file, but not my new one, it's like it isn't even in the file (Yes, I've verified that I'm modifying the correct file by altering other tasks in the file and observing my changes).

To check my sanity, I've added "debug" tasks to the file, and they are silently ignored as well, like they aren't in the file.

I'm pretty sure the module is being "discovered" in the library folder, if I alter the name of the module in the task to be different from the real module name, I get an error.

I'm pretty sure the module is working correctly, it's small and simple, and I've tested it out with Ansible's test-module; I've written others like it successfully. It's just not being used.

The complete lack of output (good or bad), including the inability to execute debug tasks, makes it difficult to debug,

I'm thinking that there is some configuration I'm missing that I set years ago in my usual ansible.cfg file (which is not used in this context). I've had a look, but nothing pops out as obvious.

Any suggestions on how to proceed?

Why would a debug task be silently ignored (Yes, I played with the verbosity setting)?

Ansible Version 2.2.2.0-rc1 6791061

Thanks, Dan

Upvotes: 3

Views: 7646

Answers (1)

Dan Ford
Dan Ford

Reputation: 224

Found it. Obvious once I figured it out, but not so obvious when one is staring at something that "should just work." As Konstantin suggested, the task was being filtered out by a tags setting. Finding it was made harder because the playbook was being invoked through two-levels of indirection (Eclipse Launch configuration->Shell Script) so it wasn't directly obvious. The other tags (that worked) had the tag, the new one I added to try out the new module, didn't, same with the debug tasks, something that was clearly visible, but still not blindingly obvious. Everything explained, but the symptom of the issue was baffling at first.

Upvotes: 3

Related Questions