add new type: __update_alternatives

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-06-19 18:49:43 +02:00
parent 4ecffa7d59
commit 84f2ca0d1f
3 changed files with 70 additions and 0 deletions

View file

@ -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 <http://www.gnu.org/licenses/>.
#
#
# Setup alternative - no standard way to create, always set
#
path="$(cat "$__object/parameter/path")"
name="$__object_id"
echo "update-alternatives --set '$name' '$path'"

View file

@ -0,0 +1,43 @@
cdist-type__update_alternatives(7)
==================================
Nico Schottelius <nico-cdist--@--schottelius.org>
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).

View file

@ -0,0 +1 @@
path