There's no reason to make sure there's enough diskspace or memory unless
we're building a container.
exit 1
fi
- # 6. sufficient available resources
- # 6a. Memory
- #
+}
+
+check_resources() {
+ # Memory
resources="ok"
avail_mem="$(LANG=C free -m | grep '^Mem:' | awk '{print $2}')"
if [ "$avail_mem" -lt 900 ]; then
fi
fi
- # 6b. Disk space
+ # Disk space
free_disk="$(df /var | tail -n 1 | awk '{print $4}')"
if [ "$free_disk" -lt 5000 ]; then
resources="insufficient"
run_bootstrap(){
+ check_resources
+
host_run
get_ssh_pub_key