2017-08-11 13:58:39 +02:00
|
|
|
---
|
2018-06-22 15:24:32 +02:00
|
|
|
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
|
|
|
#
|
2017-08-11 13:58:39 +02:00
|
|
|
# tasks file for ipr.ansible.xymon
|
|
|
|
|
|
|
|
- name: Load specific OS vars for xymon
|
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
|
|
|
- "{{ ansible_distribution|lower }}.yml"
|
|
|
|
- "{{ ansible_os_family|lower }}.yml"
|
|
|
|
|
2018-06-22 15:24:32 +02:00
|
|
|
# Manage required client packages [[[1
|
2017-08-11 13:58:39 +02:00
|
|
|
- name: client package
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: '{{ xymon_cli_pkg_state }}'
|
|
|
|
with_items:
|
2019-02-27 11:43:39 +01:00
|
|
|
- '{{ xymon_cli_pkg_list | to_nice_json }}'
|
2019-02-06 11:03:34 +01:00
|
|
|
register: cli_result
|
|
|
|
until: cli_result is success
|
2018-05-16 14:45:18 +02:00
|
|
|
when: xymon_cli_manage|bool
|
2017-08-11 13:58:39 +02:00
|
|
|
|
2018-06-22 15:24:32 +02:00
|
|
|
# Manage client configuration [[[1
|
2017-09-04 16:15:42 +02:00
|
|
|
- name: CONFIG xymon-client service
|
2017-08-11 14:33:31 +02:00
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli_default_conf_tpl }}'
|
|
|
|
dest: '{{ xymon_cli_default_conf_path }}'
|
2018-06-22 15:24:32 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2017-08-11 14:33:31 +02:00
|
|
|
backup: true
|
2018-05-16 14:45:18 +02:00
|
|
|
when: xymon_cli_manage|bool
|
2017-08-11 14:42:49 +02:00
|
|
|
notify: restart xymon-client service
|
2017-08-11 14:33:31 +02:00
|
|
|
|
2017-09-04 16:15:42 +02:00
|
|
|
- name: CONFIG xymon user's groups
|
|
|
|
user:
|
|
|
|
name: xymon
|
|
|
|
groups: '{{ xymon_user_groups }}'
|
2018-06-22 15:24:32 +02:00
|
|
|
append: true
|
2018-05-16 14:45:18 +02:00
|
|
|
when: xymon_cli_manage|bool
|
2017-09-04 16:15:42 +02:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2018-06-22 15:24:32 +02:00
|
|
|
# Manage service [[[1
|
2017-08-11 14:14:51 +02:00
|
|
|
- name: SERVICE manage '{{ xymon_cli_service_name }}'
|
|
|
|
service:
|
|
|
|
name: '{{ xymon_cli_service_name }}'
|
|
|
|
state: started
|
|
|
|
enabled: '{{ xymon_cli_service_enabled }}'
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_cli_service_manage|bool)
|
2017-09-04 17:24:40 +02:00
|
|
|
|
2018-06-22 15:24:32 +02:00
|
|
|
# Manage apt plugin [[[1
|
2018-03-02 15:15:11 +01:00
|
|
|
- name: PLUGIN apt packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
2019-05-24 10:08:06 +02:00
|
|
|
state: 'present'
|
2018-03-02 15:15:11 +01:00
|
|
|
with_items:
|
2019-02-27 11:43:39 +01:00
|
|
|
- '{{ xymon_plug_apt_package | to_nice_json }}'
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
2019-05-24 10:08:06 +02:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_plug_apt_state|bool)
|
2019-02-06 11:03:34 +01:00
|
|
|
register: apt_plug_result
|
|
|
|
until: apt_plug_result is success
|
2018-03-02 15:15:11 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN apt
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_plug_apt_tpl }}'
|
|
|
|
dest: '{{ xymon_plug_apt_path }}'
|
2018-06-22 15:24:32 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
2018-03-02 15:15:11 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2018-09-12 10:25:31 +02:00
|
|
|
- name: PLUGIN apt no_repo_accept whitelist
|
|
|
|
template:
|
|
|
|
src: 'etc/xymon/apt_no_repo_accept.j2'
|
|
|
|
dest: '/etc/xymon/apt_no_repo_accept'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2018-07-13 12:45:20 +02:00
|
|
|
# Manage ipmi plugin [[[1
|
|
|
|
- name: PLUGIN ipmi packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
2019-05-24 10:08:06 +02:00
|
|
|
state: 'present'
|
2018-07-13 12:45:20 +02:00
|
|
|
with_items:
|
2019-02-27 11:43:39 +01:00
|
|
|
- '{{ xymon_cli__plug_ipmi_package | to_nice_json }}'
|
2019-02-06 11:03:34 +01:00
|
|
|
register: ipmi_plug_result
|
|
|
|
until: ipmi_plug_result is success
|
2018-07-13 12:45:20 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
2019-05-24 10:08:06 +02:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_ipmi_state|bool)
|
2018-07-13 12:45:20 +02:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN ipmi
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_ipmi_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_ipmi_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2018-06-22 15:24:32 +02:00
|
|
|
# Manage libs plugin [[[1
|
2018-02-08 16:07:22 +01:00
|
|
|
- name: PLUGIN libs packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
2019-05-24 10:08:06 +02:00
|
|
|
state: 'present'
|
2018-02-08 16:07:22 +01:00
|
|
|
with_items:
|
2019-02-27 11:43:39 +01:00
|
|
|
- '{{ xymon_plug_libs_package | to_nice_json }}'
|
2019-02-06 11:03:34 +01:00
|
|
|
register: libs_plug_result
|
|
|
|
until: libs_plug_result is success
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
2019-05-24 10:08:06 +02:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_plug_libs_state|bool)
|
2018-02-08 16:07:22 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2017-09-04 17:42:53 +02:00
|
|
|
- name: PLUGIN libs
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_plug_libs_tpl }}'
|
|
|
|
dest: '{{ xymon_plug_libs_path }}'
|
2018-06-22 15:24:32 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
2017-09-04 17:42:53 +02:00
|
|
|
notify: restart xymon-client service
|
2018-02-08 17:28:49 +01:00
|
|
|
|
|
|
|
- name: PLUGIN libs whitelist
|
|
|
|
template:
|
|
|
|
src: 'etc/xymon/libs.local.yaml.j2'
|
|
|
|
dest: '/etc/xymon/libs.local.yaml'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2018-05-16 14:45:18 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
2018-02-08 17:28:49 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2019-05-24 09:49:54 +02:00
|
|
|
# Manage mq plugin [[[1
|
|
|
|
- name: PLUGIN mq packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
2019-05-24 10:08:06 +02:00
|
|
|
state: 'present'
|
2019-05-24 09:49:54 +02:00
|
|
|
with_items:
|
|
|
|
- '{{ xymon_plug_mq_package | to_nice_json }}'
|
|
|
|
register: mq_plug_result
|
|
|
|
until: mq_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
2019-05-24 10:08:06 +02:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_plug_mq_state|bool)
|
2019-05-24 09:49:54 +02:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN mq
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_plug_mq_tpl }}'
|
|
|
|
dest: '{{ xymon_plug_mq_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2020-10-29 17:52:19 +01:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
# Manage net plugin [[[1
|
|
|
|
- name: PLUGIN net packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: 'present'
|
|
|
|
with_items:
|
|
|
|
- '{{ xymon_cli__plug_net_package | to_nice_json }}'
|
|
|
|
register: net_plug_result
|
|
|
|
until: net_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_net_state|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN net
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_net_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_net_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2020-10-30 12:41:24 +01:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN net config template
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_net_conf_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_net_conf_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2019-05-24 09:49:54 +02:00
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
# Manage netstats plugin [[[1
|
|
|
|
- name: PLUGIN netstats packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: 'present'
|
|
|
|
with_items:
|
|
|
|
- '{{ xymon_cli__plug_netstats_package | to_nice_json }}'
|
|
|
|
register: netstats_plug_result
|
|
|
|
until: netstats_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_netstats_state|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN netstats config
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_netstats_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_netstats_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-06-09 13:57:50 +02:00
|
|
|
# Manage sge plugin [[[1
|
|
|
|
- name: PLUGIN sge config
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_sge_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_sge_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN sge script file from template
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_sge_script_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_sge_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_sge_script_url|length == 0 )
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN sge script file from URL
|
|
|
|
get_url:
|
|
|
|
url: '{{ xymon_cli__plug_sge_script_url }}'
|
|
|
|
dest: '{{ xymon_cli__plug_sge_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_sge_script_url|length > 0 )
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-02-25 15:22:37 +01:00
|
|
|
# Manage smartoverall plugin [[[1
|
|
|
|
- name: PLUGIN smartoverall packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: 'present'
|
|
|
|
with_items:
|
|
|
|
- '{{ xymon_cli__plug_smartoverall_package | to_nice_json }}'
|
|
|
|
register: smartoverall_plug_result
|
|
|
|
until: smartoverall_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smartoverall_state|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN smartoverall config
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_smartoverall_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smartoverall_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-03-05 15:23:29 +01:00
|
|
|
- name: PLUGIN smartoverall script file from template
|
2020-02-25 15:22:37 +01:00
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_smartoverall_script_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smartoverall_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
2020-03-05 15:23:29 +01:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smartoverall_script_url|length == 0 )
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN smartoverall script file from URL
|
|
|
|
get_url:
|
|
|
|
url: '{{ xymon_cli__plug_smartoverall_script_url }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smartoverall_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smartoverall_script_url|length > 0 )
|
2020-02-25 15:22:37 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-02-18 14:24:31 +01:00
|
|
|
# Manage smart plugin [[[1
|
|
|
|
- name: PLUGIN smart packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: 'present'
|
|
|
|
with_items:
|
|
|
|
- '{{ xymon_cli__plug_smart_package | to_nice_json }}'
|
|
|
|
register: smart_plug_result
|
|
|
|
until: smart_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smart_state|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN smart config
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_smart_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smart_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-03-05 15:23:29 +01:00
|
|
|
- name: PLUGIN smart script file from template
|
2020-02-18 14:24:31 +01:00
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_smart_script_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smart_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
2020-03-05 15:23:29 +01:00
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smart_script_url|length == 0 )
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN smart script file from URL
|
|
|
|
get_url:
|
|
|
|
url: '{{ xymon_cli__plug_smart_script_url }}'
|
|
|
|
dest: '{{ xymon_cli__plug_smart_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_smart_script_url|length > 0 )
|
2020-02-18 14:24:31 +01:00
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2020-10-28 11:05:51 +01:00
|
|
|
# Manage temp plugin [[[1
|
|
|
|
- name: PLUGIN temp packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: 'present'
|
|
|
|
with_items:
|
|
|
|
- '{{ xymon_cli__plug_temp_package | to_nice_json }}'
|
|
|
|
register: temp_plug_result
|
|
|
|
until: temp_plug_result is success
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool and
|
|
|
|
xymon_cli__plug_temp_state|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN temp
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_temp_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_temp_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
2018-06-22 16:04:32 +02:00
|
|
|
# Manage zfs plugin [[[1
|
|
|
|
- name: PLUGIN zfs config file
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_zfs_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_zfs_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
|
|
|
notify: restart xymon-client service
|
|
|
|
|
|
|
|
- name: PLUGIN zfs script file
|
|
|
|
template:
|
|
|
|
src: '{{ xymon_cli__plug_zfs_script_tpl }}'
|
|
|
|
dest: '{{ xymon_cli__plug_zfs_script_path }}'
|
|
|
|
owner: root
|
|
|
|
group: xymon
|
|
|
|
mode: 0755
|
|
|
|
when: (xymon_cli_manage|bool and
|
|
|
|
xymon_plug_manage|bool)
|
2019-02-06 10:19:53 +01:00
|
|
|
notify: restart xymon-client service
|