]> WPIA git - infra.git/blobdiff - manager/setup
add: backup mechanism for postgresql
[infra.git] / manager / setup
index 9481c85a57efad4f694f0a219d085abe4f0fa068..88e451636f6c81dc719677720bec44929ab444da 100755 (executable)
@@ -1,30 +1,7 @@
 #!/bin/bash
-signerLocation=self
-devPkgs=""
-targetHost="$1"
-
-function ssh_target {
-    ssh -i vm-key "$to" "$@"
-}
-
-function install_nre {
-    ./installNRE "$targetHost"
-}
-function read_activation_link {
-    read -rp "Link: " link
-    printf '%s\n' "$link"
-}
-function configure {
-    ssh_target -t 'bash conf-puppet --force'
-    ssh_target 'sed -i "s%\$signerLocation = '".*'"'%\$signerLocation = '"'$signerLocation'"'%" environments/production/manifests/ip.pp'
-}
-function do_reset_vm {
-    read -rp "Please reset your VM and confirm by pressing enter." _
-}
-function execute-bootstrap-user {
-    ssh_target -t 'bash bootstrap-user'
-}
-
+targetHost=$1
+targetHost=${targetHost%/}
+source config
 source "$targetHost/config"
 
 eval $(ssh-agent)
@@ -158,12 +135,14 @@ if [[ "$2" == "update" ]]; then
 fi
 configure
 ensure_nre
+
+install_backup
+
 title 'S3: puppet-1'
 ssh_target -t 'sudo ./bootstrap'
 title 'S3: puppet-2'
 ssh_target -t 'sudo ./bootstrap'
 
-[[ -f ../../migrate ]] && ( cd ../.. && bash migrate "$targetHost")
 if [[ -f tricks ]]; then
     cat tricks | ssh_target 'cat > tricks && chmod +x tricks'
     ssh_target -t 'bash tricks'
@@ -174,7 +153,7 @@ if [[ $signerLocation == "self" ]] && [[ $(ssh_target 'ps -ef | grep tcpseria[l]
     exit 1
 fi
 
-execute-bootstrap-user
+populate_system
 
 title 'bash'
 eval $(ssh-agent -k)