From bbd451433f86600d3a01e13ba271cc06bff902d9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 20 May 2014 07:43:11 +0200 Subject: [PATCH] add --url support for __package_yum Signed-off-by: Nico Schottelius --- cdist/conf/type/__package_yum/gencode-remote | 12 ++++++++++-- cdist/conf/type/__package_yum/man.text | 5 +++++ cdist/conf/type/__package_yum/parameter/optional | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__package_yum/gencode-remote b/cdist/conf/type/__package_yum/gencode-remote index 5f0e8ac8..32a794a0 100755 --- a/cdist/conf/type/__package_yum/gencode-remote +++ b/cdist/conf/type/__package_yum/gencode-remote @@ -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\" diff --git a/cdist/conf/type/__package_yum/man.text b/cdist/conf/type/__package_yum/man.text index d958dd1e..65e1be67 100644 --- a/cdist/conf/type/__package_yum/man.text +++ b/cdist/conf/type/__package_yum/man.text @@ -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 -------------------------------------------------------------------------------- diff --git a/cdist/conf/type/__package_yum/parameter/optional b/cdist/conf/type/__package_yum/parameter/optional index 1b423dc4..9293119d 100644 --- a/cdist/conf/type/__package_yum/parameter/optional +++ b/cdist/conf/type/__package_yum/parameter/optional @@ -1,2 +1,3 @@ name state +url