diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-01-13 12:41:28 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-01-13 12:41:28 +1000 |
commit | e8f36ed834414859e0f2ec5cd75c72cb7e1ff0e8 (patch) | |
tree | 2ae84927b0ddbbc283789d4745c162e335b0c591 /bootstrap/ubuntu1004_bootstrap.sh |
Initial commit.
Diffstat (limited to 'bootstrap/ubuntu1004_bootstrap.sh')
-rwxr-xr-x | bootstrap/ubuntu1004_bootstrap.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/bootstrap/ubuntu1004_bootstrap.sh b/bootstrap/ubuntu1004_bootstrap.sh new file mode 100755 index 0000000..9c1e2ba --- /dev/null +++ b/bootstrap/ubuntu1004_bootstrap.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Bootstrap a clean Ubuntu 10.04 system to be managed by puppet. + +REPO="$1" +if [ "x$REPO" = "x" ]; then + { + echo "Usage: $(basename $0) git://some/git/repo" + echo "" + echo "Set up this machine to be managed using the puppet config in the given" + echo "git repository (e.g. git://qt.gitorious.org/qtqa/sysadmin.git)" + } 1>&2 + exit 2 +fi + +set -e +set -x + +if ! test -e /usr/bin/puppet; then + echo Installing puppet... + apt-get -y -o DPkg::Options::=--force-confnew install puppet +else + echo puppet is already installed +fi + +if ! test -e /usr/bin/git; then + echo Installing git... + apt-get -y -o DPkg::Options::=--force-confnew install git-core +else + echo git is already installed +fi + +if ! test -d /var/qtqa/sysadmin; then + echo "Grabbing $REPO ..." + mkdir -p /var/qtqa + git clone "$REPO" /var/qtqa/sysadmin +fi + +# Run puppet once. +echo "Running puppet..." +/var/qtqa/sysadmin/puppet/sync_and_run.sh +set +x +echo 'All done :-)' +echo 'If this host already has an entry in manifests/nodes.pp, nothing needs to be done...' +echo "Otherwise, puppet is ready to go but will not do anything until you add an entry for $(facter fqdn) to manifests/nodes.pp" + |