summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Camera <cdist@dtnr.ch>2020-05-27 00:02:53 +0200
committerDennis Camera <cdist@dtnr.ch>2021-03-17 13:02:05 +0100
commiteeb17730bc2aecc384f74ba2605174b20ae18c6c (patch)
tree6ce1f4686ba3598d96b0df5f751132f2107bf76d
download__dtnrch_getssl-eeb17730bc2aecc384f74ba2605174b20ae18c6c.tar.gz
__dtnrch_getssl-eeb17730bc2aecc384f74ba2605174b20ae18c6c.zip
[type/__dtnrch_getssl] Create type
-rw-r--r--type/__dtnrch_getssl/man.rst55
-rwxr-xr-xtype/__dtnrch_getssl/manifest47
-rw-r--r--type/__dtnrch_getssl/parameter/default/state1
-rw-r--r--type/__dtnrch_getssl/parameter/optional1
-rw-r--r--type/__dtnrch_getssl/singleton0
5 files changed, 104 insertions, 0 deletions
diff --git a/type/__dtnrch_getssl/man.rst b/type/__dtnrch_getssl/man.rst
new file mode 100644
index 0000000..00ec4e9
--- /dev/null
+++ b/type/__dtnrch_getssl/man.rst
@@ -0,0 +1,55 @@
+cdist-type__dtnrch_getssl(7)
+============================
+
+NAME
+----
+cdist-type__dtnrch_getssl - Set up getssl.
+
+
+DESCRIPTION
+-----------
+This space intentionally left blank.
+
+
+REQUIRED PARAMETERS
+-------------------
+None.
+
+
+OPTIONAL PARAMETERS
+-------------------
+state
+ Whether getssl should be installed (``present``) on the target or not
+ (``absent``).
+
+
+BOOLEAN PARAMETERS
+------------------
+None.
+
+
+EXAMPLES
+--------
+
+.. code-block:: sh
+
+ # Install getssl using default settings
+ __dtnrch_getssl
+
+
+SEE ALSO
+--------
+None.
+
+
+AUTHORS
+-------
+Dennis Camera <cdist--@--dtnr.ch>
+
+
+COPYING
+-------
+Copyright \(C) 2020 Dennis Camera. 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.
diff --git a/type/__dtnrch_getssl/manifest b/type/__dtnrch_getssl/manifest
new file mode 100755
index 0000000..b90835b
--- /dev/null
+++ b/type/__dtnrch_getssl/manifest
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+#
+# 2020 Dennis Camera (cdist at dtnr.ch)
+#
+# 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/>.
+#
+
+DEST=/usr/local/bin
+
+state_should=$(cat "${__object:?}/parameter/state")
+
+case $state_should
+in
+ (present)
+ __package bash --state present # getssl is written in bash
+ __directory "${DEST}" --state present --parents
+ export require="__package/bash __directory/${DEST}"
+ ;;
+ (absent)
+ :
+ ;;
+ (*)
+ printf 'Invalid state "%s" given. Valid states are: present, absent.\n'\
+ "${state_should}" >&2
+ exit 1
+ ;;
+esac
+
+__staged_file "${DEST}/getssl" --state "${state_should}" \
+ --owner 0 --mode 0755 \
+ --source 'https://raw.githubusercontent.com/srvrco/getssl/v2.27/getssl' \
+ --cksum '2343364619 109164'
+
+__directory '/etc/getssl' --state "${state_should}" --owner 0 --mode 0750
diff --git a/type/__dtnrch_getssl/parameter/default/state b/type/__dtnrch_getssl/parameter/default/state
new file mode 100644
index 0000000..e7f6134
--- /dev/null
+++ b/type/__dtnrch_getssl/parameter/default/state
@@ -0,0 +1 @@
+present
diff --git a/type/__dtnrch_getssl/parameter/optional b/type/__dtnrch_getssl/parameter/optional
new file mode 100644
index 0000000..ff72b5c
--- /dev/null
+++ b/type/__dtnrch_getssl/parameter/optional
@@ -0,0 +1 @@
+state
diff --git a/type/__dtnrch_getssl/singleton b/type/__dtnrch_getssl/singleton
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/type/__dtnrch_getssl/singleton