325 lines
8.7 KiB
YAML
325 lines
8.7 KiB
YAML
---
|
|
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
|
#
|
|
# 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"
|
|
|
|
# Manage required client packages [[[1
|
|
- name: client package
|
|
package:
|
|
name: '{{ item }}'
|
|
state: '{{ xymon_cli_pkg_state }}'
|
|
with_items:
|
|
- '{{ xymon_cli_pkg_list | to_nice_json }}'
|
|
register: cli_result
|
|
until: cli_result is success
|
|
when: xymon_cli_manage|bool
|
|
|
|
# Manage client configuration [[[1
|
|
- name: CONFIG xymon-client service
|
|
template:
|
|
src: '{{ xymon_cli_default_conf_tpl }}'
|
|
dest: '{{ xymon_cli_default_conf_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
backup: true
|
|
when: xymon_cli_manage|bool
|
|
notify: restart xymon-client service
|
|
|
|
- name: CONFIG xymon user's groups
|
|
user:
|
|
name: xymon
|
|
groups: '{{ xymon_user_groups }}'
|
|
append: true
|
|
when: xymon_cli_manage|bool
|
|
notify: restart xymon-client service
|
|
|
|
# Manage service [[[1
|
|
- name: SERVICE manage '{{ xymon_cli_service_name }}'
|
|
service:
|
|
name: '{{ xymon_cli_service_name }}'
|
|
state: started
|
|
enabled: '{{ xymon_cli_service_enabled }}'
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_cli_service_manage|bool)
|
|
|
|
# Manage all plugins's dependencies [[[1
|
|
- name: PLUGINS dependencies
|
|
package:
|
|
name: '{{ item }}'
|
|
state: 'present'
|
|
with_items:
|
|
- '{{ xymon_cli__plug_combined_packages | to_nice_json }}'
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
register: combined_packages_plug_result
|
|
until: combined_packages_plug_result is success
|
|
notify: restart xymon-client service
|
|
|
|
# Manage apt plugin [[[1
|
|
- name: PLUGIN apt
|
|
template:
|
|
src: '{{ xymon_plug_apt_tpl }}'
|
|
dest: '{{ xymon_plug_apt_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
- 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
|
|
|
|
# Manage ipmi plugin [[[1
|
|
- 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
|
|
|
|
# Manage libs plugin [[[1
|
|
- name: PLUGIN libs
|
|
template:
|
|
src: '{{ xymon_plug_libs_tpl }}'
|
|
dest: '{{ xymon_plug_libs_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
- name: PLUGIN libs whitelist
|
|
template:
|
|
src: 'etc/xymon/libs.local.yaml.j2'
|
|
dest: '/etc/xymon/libs.local.yaml'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
# Manage megaraid plugin [[[1
|
|
- name: PLUGIN megaraid
|
|
template:
|
|
src: '{{ xymon_cli__plug_megaraid_tpl }}'
|
|
dest: '{{ xymon_cli__plug_megaraid_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
# Manage mq plugin [[[1
|
|
- name: PLUGIN mq
|
|
template:
|
|
src: '{{ xymon_plug_mq_tpl }}'
|
|
dest: '{{ xymon_plug_mq_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
# Manage net plugin [[[1
|
|
- name: PLUGIN net
|
|
template:
|
|
src: '{{ xymon_cli__plug_net_tpl }}'
|
|
dest: '{{ xymon_cli__plug_net_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
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
|
|
when: (xymon_cli_manage|bool and
|
|
xymon_plug_manage|bool)
|
|
notify: restart xymon-client service
|
|
|
|
# Manage netstats plugin [[[1
|
|
- 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
|
|
|
|
# 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
|
|
|
|
# Manage smartoverall plugin [[[1
|
|
- 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
|
|
|
|
- name: PLUGIN smartoverall script file from template
|
|
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
|
|
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 )
|
|
notify: restart xymon-client service
|
|
|
|
# Manage smart plugin [[[1
|
|
- 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
|
|
|
|
- name: PLUGIN smart script file from template
|
|
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
|
|
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 )
|
|
notify: restart xymon-client service
|
|
|
|
# Manage temp plugin [[[1
|
|
- 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
|
|
|
|
# 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)
|
|
notify: restart xymon-client service
|