Compare commits

..

No commits in common. "master" and "6.1" have entirely different histories.
master ... 6.1

18 changed files with 13 additions and 217 deletions

View file

@ -61,29 +61,31 @@ EOF
echo "curl -s -L '$uri' | apt-key add -"
fi
elif [ -d "$keydir" ]; then
tmp='/tmp/cdist_apt_key_tmp'
# we need to kill gpg after 30 seconds, because gpg
# can get stuck if keyserver is not responding.
# exporting env var and not exit 1,
# because we need to clean up and kill dirmngr.
cat << EOF
gpgtmphome="\$( mktemp -d )"
mkdir -m 700 -p "$tmp"
if timeout 30s \\
gpg --homedir "\$gpgtmphome" \\
gpg --homedir "$tmp" \\
--keyserver "$keyserver" \\
--recv-keys "$keyid"
then
gpg --homedir "\$gpgtmphome" \\
gpg --homedir "$tmp" \\
--export "$keyid" \\
> "$keyfile"
else
export GPG_GOT_STUCK=1
fi
GNUPGHOME="\$gpgtmphome" gpgconf --kill dirmngr
GNUPGHOME="$tmp" gpgconf --kill dirmngr
rm -rf "\$gpgtmphome"
rm -rf "$tmp"
if [ -n "\$GPG_GOT_STUCK" ]
then

View file

@ -1,24 +0,0 @@
#!/bin/sh -e
#
# 2019 Daniel Tschada
#
# 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/>.
#
install="$(cat "$__object/parameter/install")"
state="$(cat "$__object/parameter/state")"
user="$(cat "$__object/parameter/user")"
version="$(cat "$__object/parameter/version")"

View file

@ -1,61 +0,0 @@
cdist-type__podman_compose(7)
=============================
NAME
----
cdist-type__podman_compose - install podman-compose
DESCRIPTION
-----------
Installs podman-compose package.
State 'absent' will not remove podman binary itself,
only podman-compose binary will be removed
REQUIRED PARAMETERS
-------------------
install
defaults to 'pip'
OPTIONAL PARAMETERS
-------------------
state
'present' or 'absent', defaults to 'present'
user
the user who owns the file, defaults to 'root'
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# Install podman-compose
__podman_compose
# Install latest version via pip
__podman_compose --state present --install pip
# Install latest version via pip and change user
__podman_compose --state present --install pip --user root
# Remove podman-compose
__podman_compose --state absent
AUTHORS
-------
Daniel Tschada <mail--@--moep.name>
COPYING
-------
Copyright \(C) 2019 Daniel Tschada. Free use of this software is
granted under the terms of the GNU General Public License version 3 or later (GPLv3+).

View file

@ -1,50 +0,0 @@
#!/bin/sh -e
#
# 2019 Daniel Tschada
#
# 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/>.
#
# shellcheck disable=SC2154
# shellcheck disable=SC2034
install="$(cat "$__object/parameter/install")"
state="$(cat "$__object/parameter/state")"
user="$(cat "$__object/parameter/user")"
version="$(cat "$__object/parameter/version")"
# install it with pip
if [ "${install}" = "pip" ]; then
if [ "${state}" = "present" ]; then
__package_pip podman-compose --state present --pip /usr/local/bin/podman-compose --runas "${user}"
elif [ "${state}" = "absent" ]; then
__package_pip podman-compose --state absent
else
if [ "${state}" != "present" ] -a [ "${state}" != "absent" ]; then
echo "Unknown state: ${state}" >&2
exit 1
else
echo "Unknown user: ${user}" >&2
exit 1
fi
fi
else
echo "Unknown user: ${install}" >&2
exit 1
fi

View file

@ -1,4 +0,0 @@
install
state
user
version

View file

@ -1 +0,0 @@
install

View file

@ -27,30 +27,21 @@ servers
to. While DNS-names are ok it is discouraged, defaults to 127.0.0.1.
BOOLEAN PARAMETERS
------------------
msgcache
Enable xymon `msgcache`. Note: XYMONSERVER has to be `127.0.0.1` for using
`msgcache` (see `msgcache (8)` of the xymon documentation for details).
EXAMPLES
--------
.. code-block:: sh
# minimal, report to 127.0.0.1
# minmal, report to 127.0.0.1
__xymon_client
# specify server:
__xymon_client --servers "192.168.1.1"
# activate `msgcache` for passive client:
__xymon_client --msgcache
SEE ALSO
--------
:strong:`cdist__xymon_server`\ (7), :strong:`xymon`\ (7), :strong:`msgcache`\ (8)
:strong:`cdist__xymon_server`\ (7), :strong:`xymon`\ (7)
AUTHORS

View file

@ -34,18 +34,13 @@ esac
__package xymon-client --state "$state"
if [ -f "$__object/parameter/msgcache" ]; then
require="__package/xymon-client" __line /etc/xymon/clientlaunch.cfg \
--regex DISABLED --state absent
fi
require="__package/xymon-client" __key_value CLIENTHOSTNAME \
--file /etc/default/xymon-client \
--file /etc/default/xymon-client \
--value "'$__target_hostname'" \
--delimiter '=' \
--state "$state"
require="__package/xymon-client" __key_value XYMONSERVERS \
--file /etc/default/xymon-client \
--file /etc/default/xymon-client \
--value "'$servers'" \
--delimiter '=' \
--state "$state"

View file

@ -1 +0,0 @@
msgcache

View file

@ -23,21 +23,6 @@ confdir
deployed.
OPTIONAL PARAMETERS
-------------------
owner
passed as-is as `--owner` to `__rsync`
group
passed as-is as `--group` to `__rsync`
OPTIONAL MULTIPLE PARAMETERS
----------------------------
rsync-opts
identical to __rsync type, only `--`-options are supported
REQUIRED FILES
--------------
The directory specified by `confdir` has to contain a valid xymon-configuration
@ -54,16 +39,10 @@ EXAMPLES
# this will replace /etc/xymon/ on the target host with
# the contents from __xymon_config/files/xymon.example.com/
## the same but set ownership to `xymon:xymon` and exclude
## the `netrc`-file:
__xymon_config --confdir=xymon.example.com \
--owner xymon --group xymon \
--rsync-opts "exclude=netrc"
SEE ALSO
--------
:strong:`cdist__xymon_server`\ (7), :strong:`cdist__rsync`\ (7), :strong:`xymon`\ (7)
:strong:`cdist__xymon_server`\ (7), :strong:`xymon`\ (7)
AUTHORS
-------

View file

@ -18,26 +18,7 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
confdir=$(cat "$__object/parameter/confdir")
set --
if [ -f "$__object/parameter/owner" ]; then
owner=$(cat "$__object/parameter/owner")
set -- "$@" "--owner $owner"
fi
if [ -f "$__object/parameter/group" ]; then
group=$(cat "$__object/parameter/group")
set -- "$@" "--group $group"
fi
## pass `--rsync-opts` as-is to `__rsync`:
if [ -f "$__object/parameter/rsync-opts" ]; then
while read -r opts; do
# shellcheck disable=SC2089
set -- "$@" "--rsync-opts '$opts'"
done < "$__object/parameter/rsync-opts"
fi
# shellcheck disable=SC2068,SC2090
__rsync /etc/xymon/ \
--source "$__type/files/$confdir/" \
--rsync-opts "delete" \
$@
--rsync-opts "delete"

View file

@ -1,2 +0,0 @@
owner
group

View file

@ -1 +0,0 @@
rsync-opts

View file

@ -1,11 +1,6 @@
Changelog
---------
next:
* Type __xymon_config: Add parameters for ownership and generic rsync options (Thomas Eckert)
* Type __xymon_client: Add msgcache parameter to support passive clients (Thomas Eckert)
* Type __apt_key: Use mktemp for unique temporary gpg home (Ander Punnar)
6.1.0: 2019-11-19
* Explorer hostname, type __hostname: Support more operating systems, rewrite type and hostname explorer (Dennis Camera)