add new type `__xymon_config` to configure xymon-servers

This allows configuration of a xymon-server.
The server can be installed with `__xymon_server` or manually. In the
latter case the `ext/`-dir symlink has to be added.
This commit is contained in:
tom 2019-10-08 18:55:37 +02:00
parent 48ed7f1754
commit e9289abfab
6 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/sh -e
#
# 2018-2019 Thomas Eckert (tom at it-eckert.de)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
## to speed up config-reload we send a HUP to the server process:
cat <<-EOT
pkill -HUP xymond || { echo "HUPing xymond failed" >&2; exit 1; }
EOT

View File

@ -0,0 +1,57 @@
cdist-type__xymon_config(7)
===========================
NAME
----
cdist-type__xymon_config - Deploy a Xymon configuration-directory
DESCRIPTION
-----------
This cdist type deploys a full Xymon configuration directory from the files-dir
to the host. This type requires an installed Xymon server, e.g. deployed by
`__xymon_server`.
WARNING: This type _replaces_ the `/etc/xymon/`-directory! The previous
contents is replaced/deleted!
REQUIRED PARAMETERS
-------------------
confdir
The directory in `./files/` that contains the `/etc/xymon/`-content to be
deployed.
REQUIRED FILES
--------------
The directory specified by `confdir` has to contain a valid xymon-configuration
(`/etc/xymon/`) _plus_ the `ext/`-directory that normally resides in
`/usr/lib/xymon/server/`.
EXAMPLES
--------
.. code-block:: sh
__xymon_config --confdir=xymon.example.com
# this will replace /etc/xymon/ on the target host with
# the contents from __xymon_config/files/xymon.example.com/
SEE ALSO
--------
:strong:`cdist__xymon_server`\ (7), :strong:`xymon`\ (7)
AUTHORS
-------
Thomas Eckert <tom--@--it-eckert.de>
COPYING
-------
Copyright \(C) 2018-2019 Thomas Eckert. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

View File

@ -0,0 +1,24 @@
#!/bin/sh -e
#
# 2018-2019 Thomas Eckert (tom at it-eckert.de)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
confdir=$(cat "$__object/parameter/confdir")
__rsync /etc/xymon/ \
--source "$__type/files/$confdir/" \
--rsync-opts "delete"

View File

@ -0,0 +1 @@
confdir

View File