Merge pull request #7 from atomaka/atomaka/refactor/bootstrap
Remove need for update.sh
This commit is contained in:
commit
60503c3bd3
2 changed files with 32 additions and 43 deletions
17
bootstrap.sh
17
bootstrap.sh
|
@ -2,6 +2,21 @@
|
|||
|
||||
# BOOSTRAP SCRIPT
|
||||
# Can take a single param to allow a specific branch to be installed
|
||||
|
||||
usage() { echo "Usage: $0 [-s] [branch]" 1>&2; exit 1; }
|
||||
|
||||
while getopts "s" o; do
|
||||
case "${o}" in
|
||||
s)
|
||||
SETUP=true
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
BRANCH=$1
|
||||
|
||||
# TO BE RUN AS ROOT
|
||||
|
@ -10,6 +25,7 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
if [ "$SETUP" = true ] ; then
|
||||
# SET TIMESTAMP
|
||||
echo "America/New_York" | tee /etc/timezone
|
||||
dpkg-reconfigure --frontend noninteractive tzdata
|
||||
|
@ -30,6 +46,7 @@ apt-get update
|
|||
apt-get install puppet -y
|
||||
|
||||
gem install librarian-puppet
|
||||
fi
|
||||
|
||||
# CLONE PUPPET REPOSITORY
|
||||
cd /tmp
|
||||
|
|
28
update.sh
28
update.sh
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# UPDATE SCRIPT - on a more clever day, I might merge this with bootstrap.sh
|
||||
# Can take a single param to allow a specific branch to be installed
|
||||
BRANCH=$1
|
||||
|
||||
# TO BE RUN AS ROOT
|
||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||
echo "This script must be run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
# CLONE PUPPET REPOSITORY
|
||||
cd /tmp
|
||||
rm -rf puppet
|
||||
git clone https://github.com/atomaka/tc362.git puppet
|
||||
cd puppet
|
||||
|
||||
if [ "$BRANCH" != "" ]; then
|
||||
git fetch
|
||||
git checkout $BRANCH
|
||||
fi
|
||||
|
||||
# INSTALL MODULES
|
||||
librarian-puppet install
|
||||
|
||||
# RUN MANIFEST
|
||||
puppet apply manifests/site.pp --modulepath=modules/
|
Loading…
Reference in a new issue