add --url support for __package_yum

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
remotes/origin/feature_yum_url
Nico Schottelius 11 years ago
parent 066d0bf15a
commit bbd451433f
  1. 12
      cdist/conf/type/__package_yum/gencode-remote
  2. 5
      cdist/conf/type/__package_yum/man.text
  3. 1
      cdist/conf/type/__package_yum/parameter/optional

@ -1,6 +1,6 @@
#!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
# 2011-2014 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
@ -27,6 +27,14 @@ else
name="$__object_id"
fi
# Support installing from an URL
if [ -f "$__object/parameter/url" ]; then
install_name="$(cat "$__object/parameter/url")"
else
install_name="$name"
fi
state_should="$(cat "$__object/parameter/state")"
if grep -q -E "(centos|redhat|amazon)" "$__global/explorer/os"; then
@ -47,7 +55,7 @@ fi
case "$state_should" in
present)
echo yum $opts install \"$name\"
echo yum $opts install \"$install_name\"
;;
absent)
echo yum $opts remove \"$name\"

@ -27,6 +27,8 @@ name::
state::
Either "present" or "absent", defaults to "present"
url::
URL to use for the package
EXAMPLES
@ -41,6 +43,9 @@ __package_yum python --state present --name python2
# Remove obsolete package
__package_yum puppet --state absent
__package epel-release-6-8 \
--url http://mirror.switch.ch/ftp/mirror/epel/6/i386/epel-release-6-8.noarch.rpm
--------------------------------------------------------------------------------

Loading…
Cancel
Save