aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/backports12
-rwxr-xr-xshare/hydractl/init12
-rwxr-xr-xshare/hydractl/install4
-rwxr-xr-xshare/hydractl/puppet-reset5
-rwxr-xr-xshare/hydractl/site-pack28
5 files changed, 57 insertions, 4 deletions
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/hydractl/init b/share/hydractl/init
new file mode 100755
index 0000000..6c8264a
--- /dev/null
+++ b/share/hydractl/init
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+hydractl backports
+hydractl install_puppet
+
+mkdir -p /etc/puppet/modules
+git clone git://git.sarava.org/puppet-bootstrap /etc/puppet/modules/bootstrap
+
+# TODO: edit /etc/puppet/modules/bootstrap/manifests/site.pp to suit your needs.
+
+puppetd --no-daemonize --debug --verbose --onetime /etc/puppet/modules/bootstrap/manifests/init.pp
+puppetd --no-daemonize --debug --verbose
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"