Ansible Monit module problem

I’m testing the monit module, and I think the states are wrong, or maybe I’m making a mistake

Whether I run summary, I get:

monit summary
The Monit daemon 5.1.1 uptime: 6m

Process ‘nfsen’ running
Process ‘mongod’ running
Process ‘memcached’ running
Process ‘openvassd’ running

And in order to test the monit module I’ve created the below playbook:

  • hosts: myhostname
    user: myuser
    tasks:
  • name: Ensure NFSEN is running
    action: monit name=nfsen state=started

When I run ansible, I get an error:

ansible-playbook myplaybook.yml

PLAY [XXXXX] **********************************************************

GATHERING FACTS ***************************************************************
ok: [XXXXX]

TASK: [Ensure NFSEN is running] ************************************
failed: [XXXXX] => {“failed”: true}
msg: Process ‘nfsen’ running

FATAL: all hosts have already failed – aborting

PLAY RECAP ********************************************************************
XXXXX : ok=1 changed=0 unreachable=0 failed=1

What I’m doing wrong?

Thanks in advance

Cristobal

Perhaps some other folks using the monit module can help with this one?

Done. There’s a bug on the monit module.

diff monit monit.bk
90c90
< running = ‘Running’.lower() in out.lower()

Please send a pull request to the github project (preferred) or file a bug there.

Thanks!

Hi Michael,
I’ve opened a new issue on github ( https://github.com/ansible/ansible/issues/3468).
I’ll open a new pull request.

Thank you!

Thank you sir!