summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-22 18:23:58 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-22 18:23:58 -0300
commitc36794e899731be16f1045a9ae19878813fd9896 (patch)
treeabbfbfb6d69b2e43b1748822cfbfb2b5c5964bdd /share
parentfec2db557dcad1f52a1ffa8b612629a0b8b4c054 (diff)
downloadhydra-c36794e899731be16f1045a9ae19878813fd9896.tar.gz
hydra-c36794e899731be16f1045a9ae19878813fd9896.tar.bz2
Action changes
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/mass4
l---------share/hydra/mass-web1
-rwxr-xr-xshare/hydractl/backports12
-rwxr-xr-xshare/hydractl/init (renamed from share/hydra/init)4
-rwxr-xr-xshare/hydractl/install4
-rwxr-xr-xshare/hydractl/puppet-reset5
-rwxr-xr-xshare/hydractl/site-pack28
7 files changed, 52 insertions, 6 deletions
diff --git a/share/hydra/mass b/share/hydra/mass
new file mode 100755
index 0000000..bda6e98
--- /dev/null
+++ b/share/hydra/mass
@@ -0,0 +1,4 @@
+#!/bin/bash
+#
+# Execute commands on multiple nodes.
+#
diff --git a/share/hydra/mass-web b/share/hydra/mass-web
new file mode 120000
index 0000000..698f7d4
--- /dev/null
+++ b/share/hydra/mass-web
@@ -0,0 +1 @@
+mass \ No newline at end of file
diff --git a/share/hydractl/backports b/share/hydractl/backports
index dbf9ec1..9771d72 100755
--- a/share/hydractl/backports
+++ b/share/hydractl/backports
@@ -1,7 +1,11 @@
#!/bin/bash
+#
+# Add backports to souces.list.
+#
-# TODO: check debian version and if backports is enabled
# TODO: check backports key signature
-echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list
-apt-get update ; apt-get install debian-backports-keyring ; apt-get update
-apt-get -t lenny-backports install puppet puppetmaster
+if ! grep -q -e "^deb http://backports.debian.org/debian"; then
+ echo "deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free" >> /etc/apt/sources.list
+ apt-get update ; apt-get install debian-backports-keyring ; apt-get update
+ apt-get -t lenny-backports install puppet puppetmaster
+fi
diff --git a/share/hydra/init b/share/hydractl/init
index f1b4afe..6c8264a 100755
--- a/share/hydra/init
+++ b/share/hydractl/init
@@ -1,7 +1,7 @@
#!/bin/bash
-hydra backports
-hydra install_puppet
+hydractl backports
+hydractl install_puppet
mkdir -p /etc/puppet/modules
git clone git://git.sarava.org/puppet-bootstrap /etc/puppet/modules/bootstrap
diff --git a/share/hydractl/install b/share/hydractl/install
new file mode 100755
index 0000000..488c2ea
--- /dev/null
+++ b/share/hydractl/install
@@ -0,0 +1,4 @@
+#!/bin/bash
+#
+# System installer.
+#
diff --git a/share/hydractl/puppet-reset b/share/hydractl/puppet-reset
index 04d02b1..d009c02 100755
--- a/share/hydractl/puppet-reset
+++ b/share/hydractl/puppet-reset
@@ -1,4 +1,9 @@
#!/bin/bash
+#
+# Reset puppet SSL setup and register again.
+#
+# TODO: remove whole /var/lib/puppet?
+#
/etc/init.d/puppet stop
rm -rf /var/lib/puppet/ssl
diff --git a/share/hydractl/site-pack b/share/hydractl/site-pack
new file mode 100755
index 0000000..6e33dfd
--- /dev/null
+++ b/share/hydractl/site-pack
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Pack a website.
+#
+# TODO: put on $SITES/backups/site/$SITE, with htaccess and correct
+# ownership/permission.
+
+# Arguments
+SITES="/var/sites"
+SITE="$1"
+PACK="$1.tar.bz2"
+
+if [ -z "$SITE" ]; then
+ hydra_action_usage
+ exit 1
+elif [ ! -d "$SITE" ]; then
+ echo "No such site $SITE"
+ exit 1
+fi
+
+mkdir -p $SITES/backups
+cd $SITES/backups
+
+tar jcvf $PACK $SITES/$SITE
+md5sum $PACK > $PACK.md5
+sha1sum $PACK > $PACK.sha1
+
+echo "Saved $SITES/backups/$PACK"