mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #1842 from holta/debian-10-has-no-monit
Ugly workaround so that IIAB installs on Debian 10 Buster (which suddenly removed monit)
This commit is contained in:
commit
48f46f5036
2 changed files with 72 additions and 58 deletions
59
roles/monit/tasks/install.yml
Normal file
59
roles/monit/tasks/install.yml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
- name: Install 'monit' package
|
||||||
|
package:
|
||||||
|
name: monit
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- download
|
||||||
|
|
||||||
|
- name: Install chkconfig package (debian-8)
|
||||||
|
package:
|
||||||
|
name: chkconfig
|
||||||
|
state: present
|
||||||
|
when: is_debian and ansible_distribution_major_version == "8"
|
||||||
|
tags:
|
||||||
|
- download
|
||||||
|
|
||||||
|
- name: Install /etc/monitrc from template
|
||||||
|
template:
|
||||||
|
backup: yes
|
||||||
|
src: monitrc
|
||||||
|
dest: /etc/monitrc
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0600
|
||||||
|
|
||||||
|
# - name: Install config file /etc/monit.d/watchdog from template (NEVER RUNS, WHY?)
|
||||||
|
# template:
|
||||||
|
# src: watchdog
|
||||||
|
# dest: /etc/monit.d/watchdog
|
||||||
|
# owner: root
|
||||||
|
# group: root
|
||||||
|
# force: yes
|
||||||
|
# mode: 0755
|
||||||
|
# register: monit_config
|
||||||
|
# when: False # IS THIS A BUG ?
|
||||||
|
# until: monit_config | success
|
||||||
|
# retries: 5
|
||||||
|
# delay: 1
|
||||||
|
|
||||||
|
#TODO: create systemd script
|
||||||
|
- name: Enable 'monit' service (chkconfig monit on)
|
||||||
|
command: chkconfig monit on
|
||||||
|
when: is_debian and ansible_local.local_facts.os_ver == "debian-8"
|
||||||
|
|
||||||
|
#- name: Restart monit service
|
||||||
|
# command: service monit restart
|
||||||
|
|
||||||
|
- name: Add 'monit' variable values to {{ iiab_ini_file }}
|
||||||
|
ini_file:
|
||||||
|
path: "{{ iiab_ini_file }}"
|
||||||
|
section: monit
|
||||||
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
|
with_items:
|
||||||
|
- option: name
|
||||||
|
value: Monit
|
||||||
|
- option: description
|
||||||
|
value: '"Monit is a background service monitor which can correct problems, send email, restart services."'
|
||||||
|
- option: enabled
|
||||||
|
value: "{{ monit_enabled }}"
|
|
@ -1,59 +1,14 @@
|
||||||
- name: Install 'monit' package
|
# 2019-07-06: The 'monit' package was suddenly removed from Debian 10.0.0
|
||||||
package:
|
# "Buster" during the very final days prior to release, as confirmed by the
|
||||||
name: monit
|
# sudden disappearance of these 2 pages:
|
||||||
state: present
|
#
|
||||||
tags:
|
# https://packages.debian.org/buster/monit
|
||||||
- download
|
# https://packages.debian.org/source/buster/monit
|
||||||
|
#
|
||||||
|
# And yet Raspbian Buster (is_raspbian_10, which confusingly IIAB declares to
|
||||||
|
# be is_debian_10 in vars/raspbian-10.yml for now!) still provides 'monit' via
|
||||||
|
# apt -- so eliminating "Debian 10+" requires this funky conditional:
|
||||||
|
|
||||||
- name: Install chkconfig package (debian-8)
|
- name: Install 'monit' if monit_install and not Debian 10+
|
||||||
package:
|
include_tasks: install.yml
|
||||||
name: chkconfig
|
when: monit_install and not ((is_debian and not is_raspbian) and (not is_debian_8) and (not is_debian_9))
|
||||||
state: present
|
|
||||||
when: is_debian and ansible_distribution_major_version == "8"
|
|
||||||
tags:
|
|
||||||
- download
|
|
||||||
|
|
||||||
- name: Install /etc/monitrc from template
|
|
||||||
template:
|
|
||||||
backup: yes
|
|
||||||
src: monitrc
|
|
||||||
dest: /etc/monitrc
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0600
|
|
||||||
|
|
||||||
- name: Install config file /etc/monit.d/watchdog from template (NEVER RUNS, WHY?)
|
|
||||||
template:
|
|
||||||
src: watchdog
|
|
||||||
dest: /etc/monit.d/watchdog
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
force: yes
|
|
||||||
mode: 0755
|
|
||||||
register: monit_config
|
|
||||||
when: False # IS THIS A BUG ?
|
|
||||||
until: monit_config | success
|
|
||||||
retries: 5
|
|
||||||
delay: 1
|
|
||||||
|
|
||||||
#TODO: create systemd script
|
|
||||||
- name: Enable 'monit' service (chkconfig monit on)
|
|
||||||
command: chkconfig monit on
|
|
||||||
when: is_debian and ansible_local.local_facts.os_ver == "debian-8"
|
|
||||||
|
|
||||||
#- name: Restart monit service
|
|
||||||
# command: service monit restart
|
|
||||||
|
|
||||||
- name: Add 'monit' variable values to {{ iiab_ini_file }}
|
|
||||||
ini_file:
|
|
||||||
path: "{{ iiab_ini_file }}"
|
|
||||||
section: monit
|
|
||||||
option: "{{ item.option }}"
|
|
||||||
value: "{{ item.value }}"
|
|
||||||
with_items:
|
|
||||||
- option: name
|
|
||||||
value: Monit
|
|
||||||
- option: description
|
|
||||||
value: '"Monit is a background service monitor which can correct problems, send email, restart services."'
|
|
||||||
- option: enabled
|
|
||||||
value: "{{ monit_enabled }}"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue