]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - bin/install_script.sh
Merge branch 'dev'
[perso/Immae/Projets/Puppet.git] / bin / install_script.sh
index bd7f38bdd9008a4caf7a4b43063e84457f394b57..322a1edf2297d016427ec181313b724b9b8f1405 100755 (executable)
@@ -5,9 +5,13 @@ cat <<EOF
 $(basename $0) [options]
   --help,-h               This help
 
+  Please chose environment:
+  --environment env       Environment to use for the install
+
   One of the following options is necessary:
   --instance-id id        Id of the cloud instance
   --vps-id id             Id of the vps
+  --hetzner-id id         Id of the Hetzner server
 
   Optional arguments:
   --password password     Password of the host (only useful in case of no reboot and vps)
@@ -17,14 +21,12 @@ $(basename $0) [options]
   --no-reboot-start       Don't reboot to rescue at the beginning
   --no-reboot-end         Don't reboot to normal at the end
   --git-branch branch     Use another puppet branch (default: master)
-  --environment env       Environment to use for the install (default: production)
 EOF
 }
 
 set -e
 
 git_branch=master
-environment=production
 host_user=""
 password=""
 T=""
@@ -52,6 +54,15 @@ while [ -n "$1" ]; do
       T="ovh_vps_ssd"
       shift
       ;;
+    --hetzner-id)
+      host_id="$2"
+      if [ -z "$host_user" ]; then
+        host_user="root"
+      fi
+      [ -n "$T" ] && usage && exit 1
+      T="hetzner_server"
+      shift
+      ;;
     --password)
       password="$2"
       shift
@@ -89,7 +100,7 @@ while [ -n "$1" ]; do
   shift
 done
 
-if [ -z "$T" -o -z "$host_id" ]; then
+if [ -z "$T" -o -z "$host_id" -o -z "$environment" ]; then
   usage
   exit 1
 fi