Skip to content

Instantly share code, notes, and snippets.

Created November 21, 2016 01:18
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Ansible monit install script
# monit_version = '5.20.0'
- command: /usr/local/bin/monit --version
changed_when: False
failed_when: False
register: installed_monit
- block:
- get_url:
url: '{{ monit_version }}/monit-{{ monit_version }}-linux-x64.tar.gz'
dest: "/tmp/monit.tar.gz"
- unarchive: src=/tmp/monit.tar.gz dest=/tmp copy=no
- command: mv /tmp/monit-{{ monit_version }}/bin/monit /usr/local/bin/monit
- file: state=absent path=/tmp/monit.tar.gz
- file: state=absent path=/tmp/monit-{{ monit_version }}
when: not (installed_monit.stdout | default() | search('This is Monit version ' + monit_version))
- name: Debian | Monit | Create directories
state: directory
dest: /etc/monit/conf.d
recurse: yes
owner: root
group: root
mode: 755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment