summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/flufigut.py20
-rwxr-xr-xsrc/manage.sh7
-rwxr-xr-xsrc/update.sh43
3 files changed, 55 insertions, 15 deletions
diff --git a/src/flufigut.py b/src/flufigut.py
index ae4edb4..b1e04af 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -363,14 +363,18 @@ for w in worker:
salt = rand_string(6)
passwd.write("%s:%s\n" % (w, crypt.crypt(password, salt)));
-user = raw_input("username of administrator: ")
-if user == "":
- raise SystemExit("WARN: empty username (not creating admin account)")
-
-password = getpass.getpass("password for '%s': " % user)
-password2 = getpass.getpass("retype password for '%s': " % user)
-if password != password2:
- raise SystemExit("WARN: passwords don't match (not creating admin account)")
+if "admin" in globals:
+ user = globals['admin']['username']
+ password = globals['admin']['password']
+else:
+ user = raw_input("username of administrator (leave empty for none): ")
+ if user == "":
+ raise SystemExit("WARN: empty username (not creating admin account)")
+
+ password = getpass.getpass("password for '%s': " % user)
+ password2 = getpass.getpass("retype password for '%s': " % user)
+ if password != password2:
+ raise SystemExit("WARN: passwords don't match (not creating admin account)")
salt = rand_string(6)
passwd.write("%s:%s\n" % (user, crypt.crypt(password, salt)));
diff --git a/src/manage.sh b/src/manage.sh
index d6fb813..76f2358 100755
--- a/src/manage.sh
+++ b/src/manage.sh
@@ -52,7 +52,6 @@ deploy_all() {
tar -czf "$OUTPUT_DIR/$machine.tar.gz" "$OUTPUT_DIR/$machine"/*
scp -i "$SSH_KEY" -F "$SSH_CONFIG" "$OUTPUT_DIR/$machine.tar.gz" $SSH_USER@"$machine":/tmp
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" install "/tmp/$machine.tar.gz"
- rm "$OUTPUT_DIR/$machine.tar.gz"
fi
done
}
@@ -82,7 +81,6 @@ start_all() {
echo " $machine (manager, worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
break
fi
done
@@ -92,8 +90,6 @@ start_all() {
echo " $machine (worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
- break
fi
done
}
@@ -105,8 +101,6 @@ stop_all() {
echo " $machine (worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
- break
fi
done
for machine in "$OUTPUT_DIR"/*; do
@@ -115,7 +109,6 @@ stop_all() {
echo " $machine (manager, worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
break
fi
done
diff --git a/src/update.sh b/src/update.sh
new file mode 100755
index 0000000..ca4f028
--- /dev/null
+++ b/src/update.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# flufigut
+#
+# flufigut, the flumotion configuration utility, is a simple tool
+# that generates flumotion configuration files using pyhton jinja2
+# template engine and simplejson. flufigut generates planet.xml
+# and worker.xml files from configuration templates and an easy to
+# understand representation of the flow structure written in json.
+#
+#
+# Copyright (C) 2012 Christian Pointner <equinox@spreadspace.org>
+# Michael Gebetsroither <michael@mgeb.org>
+#
+# This file is part of flufigut.
+#
+# flufigut 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 2 of the License, or
+# any later version.
+#
+# flufigut 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 flufigut. If not, see <http://www.gnu.org/licenses/>.
+#
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 <config file>"
+ exit 1
+fi
+
+TEMPLATES="example"
+
+./manage.sh stop
+./flufigut.py "$TEMPLATES" $1
+./manage.sh deploy
+./manage.sh start
+
+exit 0