From 7b39b906fb48ddded2441b1881b12231453ffda8 Mon Sep 17 00:00:00 2001 From: samuel Date: Fri, 15 May 2020 17:01:31 +0200 Subject: [PATCH] all --- .../.cdist/type/__all_in_one/manifest | 30 +++++++++++++++++++ .../type/__all_in_one/parameter/boolean | 1 + .../type/__all_in_one/parameter/optional | 0 .../.cdist/type/__all_in_one/singleton | 0 .../.cdist/type/__colorful_file/manifest | 24 +++++++++++++++ .../type/__colorful_file/parameter/optional | 1 + .../__my_firewall/explorer/package-ensured | 9 ++++++ .../.cdist/type/__my_firewall/manifest | 0 .../type/__my_firewall/parameter/required | 1 + 9 files changed, 66 insertions(+) create mode 100644 sami/my-cdist/.cdist/type/__all_in_one/manifest create mode 100644 sami/my-cdist/.cdist/type/__all_in_one/parameter/boolean create mode 100644 sami/my-cdist/.cdist/type/__all_in_one/parameter/optional create mode 100644 sami/my-cdist/.cdist/type/__all_in_one/singleton create mode 100644 sami/my-cdist/.cdist/type/__colorful_file/manifest create mode 100644 sami/my-cdist/.cdist/type/__colorful_file/parameter/optional create mode 100644 sami/my-cdist/.cdist/type/__my_firewall/explorer/package-ensured create mode 100644 sami/my-cdist/.cdist/type/__my_firewall/manifest create mode 100644 sami/my-cdist/.cdist/type/__my_firewall/parameter/required diff --git a/sami/my-cdist/.cdist/type/__all_in_one/manifest b/sami/my-cdist/.cdist/type/__all_in_one/manifest new file mode 100644 index 0000000..1869a29 --- /dev/null +++ b/sami/my-cdist/.cdist/type/__all_in_one/manifest @@ -0,0 +1,30 @@ +os="$(cat "$__global/explorer/os")" +case "$os" in + fedora) + __package nmap-ncat --state present + __package wireshark-cli --state present + +;; + debian) + + __package netcat --state present + __package tshark --state present + + + alpine) + + __package netcat-openbsd --state present + __package tshark --state present +;; + + +*) + echo "Don't know how to manage packages on: $os" >&2 + exit 1 + ;; +esac + + + __package socat --state present __package sipcalc --state present __package sudo --state present + + diff --git a/sami/my-cdist/.cdist/type/__all_in_one/parameter/boolean b/sami/my-cdist/.cdist/type/__all_in_one/parameter/boolean new file mode 100644 index 0000000..b776efe --- /dev/null +++ b/sami/my-cdist/.cdist/type/__all_in_one/parameter/boolean @@ -0,0 +1 @@ +--with-x diff --git a/sami/my-cdist/.cdist/type/__all_in_one/parameter/optional b/sami/my-cdist/.cdist/type/__all_in_one/parameter/optional new file mode 100644 index 0000000..e69de29 diff --git a/sami/my-cdist/.cdist/type/__all_in_one/singleton b/sami/my-cdist/.cdist/type/__all_in_one/singleton new file mode 100644 index 0000000..e69de29 diff --git a/sami/my-cdist/.cdist/type/__colorful_file/manifest b/sami/my-cdist/.cdist/type/__colorful_file/manifest new file mode 100644 index 0000000..746ea5e --- /dev/null +++ b/sami/my-cdist/.cdist/type/__colorful_file/manifest @@ -0,0 +1,24 @@ +# required parameter +#servername="$(cat "$__object/parameter/servername")" + +# optional parameter +if [ -f "$__object/parameter/optional" ]; then + logdirectory="$(cat "$__object/parameter/optional")" +fi + +# optional parameter with predefined default +#loglevel="$(cat "$__object/parameter/loglevel")" + +# boolean parameter +#if [ -f "$__object/parameter/use_ssl" ]; then + # file exists -> True + # do some fancy ssl stuff +#fi + +# parameter with multiple values +#if [ -f "$__object/parameter/server_colorful" ]; then + # for alias in $(cat "$__object/parameter/server_alias"); do + # echo $alias > /some/where/useful + #done +#fi + diff --git a/sami/my-cdist/.cdist/type/__colorful_file/parameter/optional b/sami/my-cdist/.cdist/type/__colorful_file/parameter/optional new file mode 100644 index 0000000..7169fdc --- /dev/null +++ b/sami/my-cdist/.cdist/type/__colorful_file/parameter/optional @@ -0,0 +1 @@ +colorful diff --git a/sami/my-cdist/.cdist/type/__my_firewall/explorer/package-ensured b/sami/my-cdist/.cdist/type/__my_firewall/explorer/package-ensured new file mode 100644 index 0000000..0a37062 --- /dev/null +++ b/sami/my-cdist/.cdist/type/__my_firewall/explorer/package-ensured @@ -0,0 +1,9 @@ +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +# Expect dpkg failing, if package is not known / installed +dpkg -s "$name" 2>/dev/null || exit 0 + diff --git a/sami/my-cdist/.cdist/type/__my_firewall/manifest b/sami/my-cdist/.cdist/type/__my_firewall/manifest new file mode 100644 index 0000000..e69de29 diff --git a/sami/my-cdist/.cdist/type/__my_firewall/parameter/required b/sami/my-cdist/.cdist/type/__my_firewall/parameter/required new file mode 100644 index 0000000..f73f309 --- /dev/null +++ b/sami/my-cdist/.cdist/type/__my_firewall/parameter/required @@ -0,0 +1 @@ +file