Browse Source

dispatch xymon role into two role client and server to made deployment easier

master
LecygneNoir 7 years ago
parent
commit
c3abdf3a7b
9 changed files with 120 additions and 18 deletions
  1. +2
    -2
      README.md
  2. +0
    -0
      roles/xymon-client/handlers/main.yml
  3. +0
    -0
      roles/xymon-client/tasks/client.yml
  4. +11
    -15
      roles/xymon-client/tasks/main.yml
  5. +16
    -0
      roles/xymon-server/handlers/main.yml
  6. +82
    -0
      roles/xymon-server/tasks/main.yml
  7. +0
    -0
      roles/xymon-server/tasks/server.yml
  8. +1
    -1
      xymon-client.yml
  9. +8
    -0
      xymon-server.yml

+ 2
- 2
README.md View File

@ -37,13 +37,13 @@ roles
* provides a lambda **MariaDB** server peered on ``127.0.0.1:3306`` with ``root`` MySQL password on ``~/.my.cnf``
* ownCloud
* provides a simple instance of **ownCloud**, with ``NGINX, PHP5-FPM, and MariaDB``
* xymon
* xymon-client and xymon-server
* https://www.xymon.com/
* Provide installation of xymon server and xymon client monitoring system
* Available for Debian (6 to 8) and Centos (6 to 7). **WARN** : xymon-server only for Debian (Centos dependencies are really hard to automate)
* Configure apache for xymon-server
* Configure xymon client and add the client in xymon server configuration to allow fetch data
* **Note** : Using xymon-client tag needs a working xymon-server (whenever the server was installed with the playbook or not)
* **Note** : Using xymon-client tag/role needs a working xymon-server (whenever the server was installed with the playbook or not)
* Cloud be (theoretically, to be tested) used to update xymon server binaries to last stable release
* ovzdb
* http://projets.developpeur-neurasthenique.fr/projects/openvz-diff-backups

roles/xymon/handlers/main.yml → roles/xymon-client/handlers/main.yml View File


roles/xymon/tasks/client.yml → roles/xymon-client/tasks/client.yml View File


roles/xymon/tasks/main.yml → roles/xymon-client/tasks/main.yml View File

@ -3,7 +3,7 @@
##
## Role to install xymon client or xymon server on host depending what is needed
##
## Tags :
## Tags :
## - xymon-server : binaries and configuration server side
## - xymon-client : binaries and configuration client side (need a working server)
## - client-configuration : used to configure client only (no binaries)
@ -15,39 +15,39 @@
##Check vars
- name: check xymon_server
fail: msg="Missing variable xymon_server"
tags:
tags:
- xymon-client
- xymon-server
when: xymon_server is not defined
- name: check xymon_checks
fail: msg="Missing variable xymon_checks"
tags:
tags:
- xymon-client
- client-configuration
when: xymon_checks is not defined
- name: check monitoring_ip
fail: msg="Missing variable monitoring_ip"
tags:
tags:
- xymon-client
- client-configuration
when: monitoring_ip is not defined
- name: check server htpasswd name
fail: msg="Missing variable xymon_htname"
tags:
tags:
- xymon-server
- server-configuration
when: xymon_htname is not defined
- name: check server htpasswd password
fail: msg="Missing variable xymon_htpasswd"
tags:
tags:
- xymon-server
- server-configuration
when: xymon_htpasswd is not defined
## Custom Facts
- name: Set Facts Debian
@ -58,12 +58,12 @@
client_name: "hobbit"
client_name_cfg: "$HOBBITCLIENTHOME"
client_name_logs: "$BBCLIENTLOGS"
tags:
tags:
- xymon-client
- xymon-server
- configuration
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Set Facts CentOs
set_fact:
xymon_cfg_path: "/etc/xymon-client/client.d"
@ -72,15 +72,11 @@
client_name: "xymon"
client_name_cfg: "$XYMONCLIENTHOME"
client_name_logs: "$XYMONCLIENTLOGS"
tags:
tags:
- xymon-client
- xymon-server
- configuration
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux'
##Main tasks
- include: server.yml
- include: client.yml

+ 16
- 0
roles/xymon-server/handlers/main.yml View File

@ -0,0 +1,16 @@
---
- name: restart xymon-hobbit-service
service: name={{ client_name }}-client state=restarted
- name: reload xymon-hobbit-service
service: name={{ client_name }}-client state=reloaded
- name: restart hobbit-client
service: name=hobbit-client state=restarted
- name: restart xymon-client
service: name=xymon-client state=restarted
- name: restart apache
service: name=apache2 state=restarted

+ 82
- 0
roles/xymon-server/tasks/main.yml View File

@ -0,0 +1,82 @@
---
##
##
## Role to install xymon client or xymon server on host depending what is needed
##
## Tags :
## - xymon-server : binaries and configuration server side
## - xymon-client : binaries and configuration client side (need a working server)
## - client-configuration : used to configure client only (no binaries)
## - client-packages : used only install client binaries (no configuration)
## - server-configuration : used to configure server only (no binaries)
## - server-packages : used to only install server binaries (no configuration)
########
##Check vars
- name: check xymon_server
fail: msg="Missing variable xymon_server"
tags:
- xymon-client
- xymon-server
when: xymon_server is not defined
- name: check xymon_checks
fail: msg="Missing variable xymon_checks"
tags:
- xymon-client
- client-configuration
when: xymon_checks is not defined
- name: check monitoring_ip
fail: msg="Missing variable monitoring_ip"
tags:
- xymon-client
- client-configuration
when: monitoring_ip is not defined
- name: check server htpasswd name
fail: msg="Missing variable xymon_htname"
tags:
- xymon-server
- server-configuration
when: xymon_htname is not defined
- name: check server htpasswd password
fail: msg="Missing variable xymon_htpasswd"
tags:
- xymon-server
- server-configuration
when: xymon_htpasswd is not defined
## Custom Facts
- name: Set Facts Debian
set_fact:
xymon_cfg_path: "/usr/lib/hobbit/client/etc/clientlaunch.d"
xymon_ext_path: "/usr/lib/hobbit/client/ext"
xymon_binary: "/usr/lib/hobbit/client/bin/bb"
client_name: "hobbit"
client_name_cfg: "$HOBBITCLIENTHOME"
client_name_logs: "$BBCLIENTLOGS"
tags:
- xymon-client
- xymon-server
- configuration
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Set Facts CentOs
set_fact:
xymon_cfg_path: "/etc/xymon-client/client.d"
xymon_ext_path: "/etc/xymon-client/ext"
xymon_binary: "/usr/share/xymon-client/bin/xymon"
client_name: "xymon"
client_name_cfg: "$XYMONCLIENTHOME"
client_name_logs: "$XYMONCLIENTLOGS"
tags:
- xymon-client
- xymon-server
- configuration
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux'
##Main tasks
- include: server.yml

roles/xymon/tasks/server.yml → roles/xymon-server/tasks/server.yml View File


xymon.yml → xymon-client.yml View File

@ -5,4 +5,4 @@
user: root
gather_facts: yes
roles:
- xymon
- xymon-client

+ 8
- 0
xymon-server.yml View File

@ -0,0 +1,8 @@
---
- name: Install and configure xymon-client or xymon-server
hosts: all
user: root
gather_facts: yes
roles:
- xymon-server

Loading…
Cancel
Save