50c3686fbfb756fcc22d2d19be8ae8ac6874de86
[doctor.git] / tests / lib / installers / local
1 #!/bin/bash
2
3 COMPUTE_USER=${COMPUTE_USER:-$(whoami)}
4 ssh_opts_cpu="$ssh_opts"
5
6 function installer_get_ssh_keys {
7     echo "INSTALLER_TYPE set to 'local'. Assuming SSH keys already exchanged with $COMPUTE_HOST"
8     return
9 }
10
11 function installer_apply_patches {
12     # Noop
13     return
14 }
15
16 function setup_installer {
17     installer_get_ssh_keys
18     installer_apply_patches
19 }
20
21 function get_compute_ip_from_hostname {
22     local compute_host=$1
23
24     if is_set COMPUTE_IP; then
25         echo "Using pre-configured COMPUTE_IP=$COMPUTE_IP ..."
26         return
27     fi
28     COMPUTE_IP=$(getent hosts "$compute_host" | awk '{ print $1 }')
29     die_if_not_set $LINENO COMPUTE_IP \
30         "Could not resolve $compute_host. Either manually set COMPUTE_IP or enable DNS resolution."
31 }
32
33 function cleanup_installer {
34     # Noop
35     return
36 }