Hello All,I need to monitor MongoDB replica set using Ansible
I have created below playbook, i need some guidance on the same
if some one has done this before please help.---- name: check the MongoDB replicaset statushosts: mongodb1become: yesbecome_method: sutasks:- name: check for the status of MongoDBcommunity.mongodb.mongodb_status:replica_set: rs0poll: 5interval: 10when: ansible_hostname == "mongodb1"register: rs_status- name: send email notification based on Replica set statusmail:host: xxx.xxx.xxx.xxxport: xxxxxxxxsender: ''to: ''subject: 'Report for replicaset'body: ''delegate_to:when: (rs_status != "PRIMARY" ) or (rs_status != "SECONDARY") or (rs_status != "ARBITER" )
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c85bc0f1-37c4-4df6-9157-97e77955b3a6n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLa2Kj6wM_RuEffucW3m2KhkDV9BmXvheA99X0CavPpcMg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAON3ZR20gx43YF-6NiD7skL-tuxuXZL8OzCNSHyE84jvKof_4g%40mail.gmail.com.