From 88c85e848c4f496c45546f4c9d1be67a6fd38ba2 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 21 Apr 2015 11:52:28 +1000 Subject: [PATCH] fix the puppet/facter issue for #45 --- files/rundeck_version | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/files/rundeck_version b/files/rundeck_version index ed2c2d105..6d74983e3 100755 --- a/files/rundeck_version +++ b/files/rundeck_version @@ -1,3 +1,11 @@ -# Ask puppet what version of rundeck is installed. -# Will return the version or if not available: "absent". -puppet resource package rundeck | grep ensure | awk '{print $NF}' | sed "s/'//g;s/,//g" +#!/bin/env bash + +if [ -x /usr/bin/dpkg ]; then + VERSION=`dpkg -l | grep rundeck | awk '{ print $3}'` + echo "rundeck_version=$VERSION" +fi + +if [ -x /usr/bin/yum ]; then + VERSION=`yum list installed|awk '/rundeck\./{print $2}'` + echo "rundeck_version=$VERSION" +fi