Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
|
98b44739e8 | ||
|
b8c6f8c8f5 | ||
8efd2681db | |||
01bd01573e | |||
|
ac2463fe31 | ||
96ffb4fd02 | |||
37ee988d1f | |||
552860b9cd | |||
34bd96db4b |
18 changed files with 217 additions and 13 deletions
|
@ -61,31 +61,29 @@ 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
|
||||
|
||||
mkdir -m 700 -p "$tmp"
|
||||
gpgtmphome="\$( mktemp -d )"
|
||||
|
||||
if timeout 30s \\
|
||||
gpg --homedir "$tmp" \\
|
||||
gpg --homedir "\$gpgtmphome" \\
|
||||
--keyserver "$keyserver" \\
|
||||
--recv-keys "$keyid"
|
||||
then
|
||||
gpg --homedir "$tmp" \\
|
||||
gpg --homedir "\$gpgtmphome" \\
|
||||
--export "$keyid" \\
|
||||
> "$keyfile"
|
||||
else
|
||||
export GPG_GOT_STUCK=1
|
||||
fi
|
||||
|
||||
GNUPGHOME="$tmp" gpgconf --kill dirmngr
|
||||
GNUPGHOME="\$gpgtmphome" gpgconf --kill dirmngr
|
||||
|
||||
rm -rf "$tmp"
|
||||
rm -rf "\$gpgtmphome"
|
||||
|
||||
if [ -n "\$GPG_GOT_STUCK" ]
|
||||
then
|
||||
|
|
24
cdist/conf/type/__podman_compose/gencode-remote
Normal file
24
cdist/conf/type/__podman_compose/gencode-remote
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/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")"
|
61
cdist/conf/type/__podman_compose/man.rst
Normal file
61
cdist/conf/type/__podman_compose/man.rst
Normal file
|
@ -0,0 +1,61 @@
|
|||
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+).
|
50
cdist/conf/type/__podman_compose/manifest
Executable file
50
cdist/conf/type/__podman_compose/manifest
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/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
|
|
@ -0,0 +1 @@
|
|||
pip
|
1
cdist/conf/type/__podman_compose/parameter/default/state
Normal file
1
cdist/conf/type/__podman_compose/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
|||
present
|
1
cdist/conf/type/__podman_compose/parameter/default/user
Normal file
1
cdist/conf/type/__podman_compose/parameter/default/user
Normal file
|
@ -0,0 +1 @@
|
|||
root
|
4
cdist/conf/type/__podman_compose/parameter/optional
Normal file
4
cdist/conf/type/__podman_compose/parameter/optional
Normal file
|
@ -0,0 +1,4 @@
|
|||
install
|
||||
state
|
||||
user
|
||||
version
|
1
cdist/conf/type/__podman_compose/parameter/required
Normal file
1
cdist/conf/type/__podman_compose/parameter/required
Normal file
|
@ -0,0 +1 @@
|
|||
install
|
0
cdist/conf/type/__podman_compose/singleton
Normal file
0
cdist/conf/type/__podman_compose/singleton
Normal file
|
@ -27,21 +27,30 @@ 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
|
||||
|
||||
# minmal, report to 127.0.0.1
|
||||
# minimal, 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:`cdist__xymon_server`\ (7), :strong:`xymon`\ (7), :strong:`msgcache`\ (8)
|
||||
|
||||
|
||||
AUTHORS
|
||||
|
|
|
@ -34,6 +34,11 @@ 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 \
|
||||
--value "'$__target_hostname'" \
|
||||
|
|
1
cdist/conf/type/__xymon_client/parameter/boolean
Normal file
1
cdist/conf/type/__xymon_client/parameter/boolean
Normal file
|
@ -0,0 +1 @@
|
|||
msgcache
|
|
@ -23,6 +23,21 @@ 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
|
||||
|
@ -39,10 +54,16 @@ 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:`xymon`\ (7)
|
||||
:strong:`cdist__xymon_server`\ (7), :strong:`cdist__rsync`\ (7), :strong:`xymon`\ (7)
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
|
|
|
@ -18,7 +18,26 @@
|
|||
# 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" \
|
||||
$@
|
||||
|
|
2
cdist/conf/type/__xymon_config/parameter/optional
Normal file
2
cdist/conf/type/__xymon_config/parameter/optional
Normal file
|
@ -0,0 +1,2 @@
|
|||
owner
|
||||
group
|
|
@ -0,0 +1 @@
|
|||
rsync-opts
|
|
@ -1,6 +1,11 @@
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue