From 1b1b345263e72f9dfa4a4bd8b8a61892b45f04a3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 28 Mar 2015 03:20:28 +0900 Subject: [PATCH] add initial type for building preos Signed-off-by: Nico Schottelius --- cdist/conf/type/__cdist_preos/man.text | 38 ++++++++++++++ cdist/conf/type/__cdist_preos/manifest | 49 +++++++++++++++++++ .../__cdist_preos/parameter/default/branch | 1 + .../__cdist_preos/parameter/default/source | 1 + .../__cdist_preos/parameter/default/username | 1 + .../type/__cdist_preos/parameter/optional | 4 ++ 6 files changed, 94 insertions(+) create mode 100644 cdist/conf/type/__cdist_preos/man.text create mode 100755 cdist/conf/type/__cdist_preos/manifest create mode 100644 cdist/conf/type/__cdist_preos/parameter/default/branch create mode 100644 cdist/conf/type/__cdist_preos/parameter/default/source create mode 100644 cdist/conf/type/__cdist_preos/parameter/default/username create mode 100644 cdist/conf/type/__cdist_preos/parameter/optional diff --git a/cdist/conf/type/__cdist_preos/man.text b/cdist/conf/type/__cdist_preos/man.text new file mode 100644 index 00000000..19caa8e2 --- /dev/null +++ b/cdist/conf/type/__cdist_preos/man.text @@ -0,0 +1,38 @@ +cdist-type__cdist_preos(7) +========================== +Nico Schottelius + + +NAME +---- +cdist-type__cdist - Manage cdist installations + + +DESCRIPTION +----------- +This cdist type creates a directory containing an operating +suitable for installation using cdist. + +REQUIRED PARAMETERS +------------------- + +OPTIONAL PARAMETERS +------------------- +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__cdist_preos /tmp/random_name_for_packaging +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__cdist(7) + + +COPYING +------- +Copyright \(C) 2015 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__cdist_preos/manifest b/cdist/conf/type/__cdist_preos/manifest new file mode 100755 index 00000000..8bb2175f --- /dev/null +++ b/cdist/conf/type/__cdist_preos/manifest @@ -0,0 +1,49 @@ +#!/bin/sh +# +# 2015 Nico Schottelius (nico-cdist at schottelius.org) +# +# 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 . +# +# + +destination="/$__object_id" + +os=$(cat "$__global/explorer/os") + +case "$os" in + archlinux) + # any linux should work + : + ;; + *) + echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 + echo "Please contribute an implementation for it if you can." >&2 + exit 1 + ;; +esac + +# Our root +__directory "$destination" \ + --mode 0755 + +for rootdir in boot bin etc lib; do + require="__directory/$destination" __directory "$destination/$rootdir" \ + --mode 0755 +done + + +require="__directory/$destination/etc" __cdistmarker \ + --destination "$destination/etc/cdist-configured" diff --git a/cdist/conf/type/__cdist_preos/parameter/default/branch b/cdist/conf/type/__cdist_preos/parameter/default/branch new file mode 100644 index 00000000..1f7391f9 --- /dev/null +++ b/cdist/conf/type/__cdist_preos/parameter/default/branch @@ -0,0 +1 @@ +master diff --git a/cdist/conf/type/__cdist_preos/parameter/default/source b/cdist/conf/type/__cdist_preos/parameter/default/source new file mode 100644 index 00000000..d669308f --- /dev/null +++ b/cdist/conf/type/__cdist_preos/parameter/default/source @@ -0,0 +1 @@ +git://github.com/telmich/cdist.git diff --git a/cdist/conf/type/__cdist_preos/parameter/default/username b/cdist/conf/type/__cdist_preos/parameter/default/username new file mode 100644 index 00000000..a585e141 --- /dev/null +++ b/cdist/conf/type/__cdist_preos/parameter/default/username @@ -0,0 +1 @@ +cdist diff --git a/cdist/conf/type/__cdist_preos/parameter/optional b/cdist/conf/type/__cdist_preos/parameter/optional new file mode 100644 index 00000000..a5f14343 --- /dev/null +++ b/cdist/conf/type/__cdist_preos/parameter/optional @@ -0,0 +1,4 @@ +branch +source +username +shell