diff --git a/README.md b/README.md index b57e920..7eed4e8 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ Monit ======== -Ansible role for configuring Monit. Sample usage see [example.yml](http://github.com/pgolm/ansible-playbook-monit/blob/master/example.yml). +Ansible role for configuring Monit. Sample usage see [example.yml](https://github.com/Skowt/ansible-role-monit/blob/master/example.yml). Install ------- -Install this role with [ansible-galaxy](https://galaxy.ansible.com/pgolm/monit/). +Install this role with [ansible-galaxy](https://galaxy.ansible.com/skowt/ansible_role_monit). ```shell -$ ansible-galaxy install pgolm.monit +$ ansible-galaxy install skowt.ansible_role_monit ``` Requirements @@ -43,6 +43,7 @@ Role Variables * `monit_mailserver_timeout`: Timeout for mailserver connection. Defaults to `5`. * `monit_mailserver_ssl_version`: If defined, monit will use this algorithm for SSL connection to the mail server. Possible values are `SSLAUTO`, `SSLV2`, `SSLV3`, `TLSV1`, `TLSV11`, `TLSV12`. * `monit_alert_addresses`: List of mail addresses where the alerts will be sent to. +* `monit_ignored_actions`: List of actions that shouldn't trigger an email. Optional. * `monit_alert_mail_format`: A hash of options for mail-format. * `from`: Sender mail address. * `reply-to`: A reply-to mail address. @@ -71,6 +72,7 @@ Feel free to contribute by add issue and pull request. CONTRIBUTORS ------------ +* [Skowt](https://github.com/Skowt) * [Amnay](https://github.com/amnay-mo) * [Anthony Dmitriyev](https://github.com/antstorm) * [byteshiva](http://byteshiva.github.io/) diff --git a/defaults/main.yml b/defaults/main.yml index d2c14c5..ac97d06 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,6 +10,7 @@ monit_service_delete_unlisted: true monit_mail_enabled: false monit_mailserver_host: localhost monit_mailserver_port: 25 +monit_ignored_actions: "instance, action" monit_webinterface_enabled: true monit_webinterface_bind: 0.0.0.0 diff --git a/tasks/mail.yml b/tasks/mail.yml index bdba9a6..b42de4e 100644 --- a/tasks/mail.yml +++ b/tasks/mail.yml @@ -2,7 +2,7 @@ - name: mail - Setup mail alerts template: src: mail.j2 - dest: {{ monit_includes }}/mail + dest: "{{ monit_includes }}/mail" owner: root group: root mode: 0644 diff --git a/tasks/service.yml b/tasks/service.yml index 7e4a27a..38d14ce 100644 --- a/tasks/service.yml +++ b/tasks/service.yml @@ -4,4 +4,3 @@ name: "{{ monit_service }}" state: started enabled: yes - diff --git a/templates/mail.j2 b/templates/mail.j2 index 130acd9..0a0c102 100644 --- a/templates/mail.j2 +++ b/templates/mail.j2 @@ -10,7 +10,7 @@ set mailserver {{ monit_mailserver_host }} port {{ monit_mailserver_port }} with timeout {{ monit_mailserver_timeout | default(5) }} seconds {% for address in monit_alert_addresses %} -set alert {{ address }} +set alert {{ address }} not on { {{ monit_ignored_actions }} } {% endfor -%} {% if monit_alert_mail_format is defined -%}