From 84f2ca0d1f59f3f2157d4350de65800a0a759459 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 19 Jun 2013 18:49:43 +0200 Subject: [PATCH] add new type: __update_alternatives Signed-off-by: Nico Schottelius --- .../type/__update_alternatives/gencode-remote | 26 +++++++++++ .../conf/type/__update_alternatives/man.text | 43 +++++++++++++++++++ .../__update_alternatives/parameter/required | 1 + 3 files changed, 70 insertions(+) create mode 100755 cdist/conf/type/__update_alternatives/gencode-remote create mode 100644 cdist/conf/type/__update_alternatives/man.text create mode 100644 cdist/conf/type/__update_alternatives/parameter/required diff --git a/cdist/conf/type/__update_alternatives/gencode-remote b/cdist/conf/type/__update_alternatives/gencode-remote new file mode 100755 index 00000000..51c0a7f4 --- /dev/null +++ b/cdist/conf/type/__update_alternatives/gencode-remote @@ -0,0 +1,26 @@ +#!/bin/sh +# +# 2013 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 . +# +# +# Setup alternative - no standard way to create, always set +# + +path="$(cat "$__object/parameter/path")" +name="$__object_id" +echo "update-alternatives --set '$name' '$path'" diff --git a/cdist/conf/type/__update_alternatives/man.text b/cdist/conf/type/__update_alternatives/man.text new file mode 100644 index 00000000..2bcc1874 --- /dev/null +++ b/cdist/conf/type/__update_alternatives/man.text @@ -0,0 +1,43 @@ +cdist-type__update_alternatives(7) +================================== +Nico Schottelius + + +NAME +---- +cdist-type__update_alternatives - Configure alternatives + + +DESCRIPTION +----------- +On Debian and alike systems update-alternatives(1) can be used +to setup alternatives for various programs. +One of the most common used targets is the "editor". + + +REQUIRED PARAMETERS +------------------- +path:: + Use this path for the given alternative + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Setup vim as the default editor +__update_alternatives editor --path /usr/bin/vim.basic +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__debconf_set_selections(7) +- update-alternatives(8) + + +COPYING +------- +Copyright \(C) 2013 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/__update_alternatives/parameter/required b/cdist/conf/type/__update_alternatives/parameter/required new file mode 100644 index 00000000..e7a8fd4d --- /dev/null +++ b/cdist/conf/type/__update_alternatives/parameter/required @@ -0,0 +1 @@ +path