summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class24
1 files changed, 23 insertions, 1 deletions
diff --git a/it.class b/it.class
index d62a57c..c8b4d19 100644
--- a/it.class
+++ b/it.class
@@ -569,7 +569,7 @@ static function shell_command(/* $cmd, $values1 = array(), ... */)
foreach ($args as $arg)
$values = array_merge($values, (array)$arg);
- #for escapeshellarg in it::_exec_quotevalue
+ # for escapeshellarg in it::_exec_quotevalue
$oldlocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, 'de_CH');
foreach (it::match('({(-?)([a-z0-9]\w*)})', $cmd, array('all' => true)) as $tags)
@@ -616,6 +616,28 @@ static function _exec_quotevalue($value, $errmsg = "")
/**
+ * execute a command on all cluster hosts of the current service
+ * @params see it::exec()
+ * @see it::exec, /opt/ultra/bin/cdist
+ */
+static function cexec(/* $cmd, $values1 = array(), ... */)
+{
+ return it::exec('cdist -c {CMD}', 'CMD' => call_user_func_array('it::shell_command', func_get_args()));
+}
+
+
+/**
+ * distribute local files to all cluster hosts of the current service
+ * @params $files filename or array of files to distribute
+ * @see it::exec, /opt/ultra/bin/cdist
+ */
+static function cdist(/* $cmd, $values1 = array(), ... */)
+{
+ return it::exec('cdist {FILES}', 'FILES' => func_get_args());
+}
+
+
+/**
* Convert an image to a given size and type (ensures input is an image)
* @param $p['in'] Input filename (mandatory)
* @param $p['out'] Output filename (mandatory)