Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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/)
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tasks/mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tasks/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
name: "{{ monit_service }}"
state: started
enabled: yes

2 changes: 1 addition & 1 deletion templates/mail.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down