From 098be2f3896aaac064a29827792f28c4b4005ea4 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Sat, 26 Dec 2020 20:03:28 +0000 Subject: [PATCH] Many update * Move all configs into config directory * Move all examples into example directoy * Move all common functions into functions.sh * Fine tune a few other functions * Moved common hypervisor config away * Added examples for some of the hypervisor configs * Start work on snap enablement of boostrap-maas.sh script --- README.md | 8 +- asrock02.config | 46 ------ bootstrap-maas.sh | 143 ++++++++++-------- configs/asrock01.config | 7 + configs/asrock02.config | 7 + configs/asrock03.config | 7 + default.config => configs/default.config | 0 configs/hp01.config | 14 ++ .../hypervisor.common.config | 6 - .../hypervisor.config | 0 maas.config => configs/maas.config | 0 rpi4-maas.config => configs/rpi4-maas.config | 6 +- .../hypervisor.config.example.bridge | 15 +- examples/hypervisor.config.example.network | 20 +++ .../maas.config.example | 0 .../maas.debconf.example | 0 functions.sh | 109 +++++++++++++ manage-hypervisor-nodes.sh | 99 +++--------- manage-maas-nodes.sh | 66 +------- 19 files changed, 282 insertions(+), 271 deletions(-) delete mode 100644 asrock02.config create mode 100644 configs/asrock01.config create mode 100644 configs/asrock02.config create mode 100644 configs/asrock03.config rename default.config => configs/default.config (100%) create mode 100644 configs/hp01.config rename asrock01.config => configs/hypervisor.common.config (83%) rename hypervisor.config => configs/hypervisor.config (100%) rename maas.config => configs/maas.config (100%) rename rpi4-maas.config => configs/rpi4-maas.config (92%) rename hp01.config => examples/hypervisor.config.example.bridge (50%) create mode 100644 examples/hypervisor.config.example.network rename maas.config.example => examples/maas.config.example (100%) rename maas.debconf.example => examples/maas.debconf.example (100%) create mode 100644 functions.sh diff --git a/README.md b/README.md index 62751f7..4bd48f7 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ This is a quick-and-dirty set of shell scripts that will build out and bootstrap a MAAS environment with all of the bits and pieces you need to get it running for any cloud, any workload. -* `manage-maas-nodes`...: Create kvm instances that MAAS will manage -* `bootstrap--maas.sh`..: Build and bootstrap your MAAS environment +* `manage-maas-nodes.sh.......`: Create kvm instances that MAAS will manage +* `manage-hypervisor-nodes.sh.`: Create hypervisors that MAAS will manage +* `bootstrap-maas.sh..........`: Build and bootstrap your MAAS environment There are plenty of options to customize its behavior, as well as drop in to any step of the process without rebuilding the full MAAS from scratch. - ## Requirements Requires, minimally, `bash`, `jq` and a working Ubuntu environment. This @@ -18,7 +18,6 @@ has **not** been tested on CentOS or Debian, but should work minimally on those environments, if you choose to make that your host. Patches are welcome, of course. - ## Components ``` @@ -45,7 +44,6 @@ newer PostgreSQL dependencies. MAAS from snap is also not supported (yet) again for the same SQL dependencies which are included inside the MAAS snap. - ## TODO and What's Next * Support for using MAAS from snap vs. main or PPA. With snap, postgresql diff --git a/asrock02.config b/asrock02.config deleted file mode 100644 index 95e63c4..0000000 --- a/asrock02.config +++ /dev/null @@ -1,46 +0,0 @@ -hypervisor_name=asrock02 -hypervisor_ip=10.0.1.251 -hypervisor_mac="a8:a1:59:44:76:79" - -external_vlan=1 - -qemu_connection="qemu+ssh://virsh@${hypervisor_ip}/system" -qemu_password="SgUoBByKjG9Lj78SwfWAHXD8DvgE67Cu" - -storage_path="/var/lib/libvirt/maas-images" - -compute="as2-maas-node" - -control_count=1 -control_cpus=3 -control_ram=8192 - -node_count=11 -node_start=1 -node_cpus=2 -node_ram=4096 - -disks=() -disks+=(50) -disks+=(20) -disks+=(20) - -network_type=bridge - -vlans=() -vlans+=(300) -vlans+=(301) -vlans+=(302) -vlans+=(303) -vlans+=(304) -vlans+=(305) -vlans+=(1) - -bridges=() -bridges+=("br0") -bridges+=("br1") -bridges+=("br2") -bridges+=("br3") -bridges+=("br4") -bridges+=("br5") -bridges+=("br6") diff --git a/bootstrap-maas.sh b/bootstrap-maas.sh index 7dbfe4b..b130a33 100755 --- a/bootstrap-maas.sh +++ b/bootstrap-maas.sh @@ -39,6 +39,8 @@ init_variables() { core_packages=( jq moreutils uuid ) maas_packages=( maas maas-cli maas-proxy maas-dhcp maas-dns maas-rack-controller maas-region-api maas-common ) pg_packages=( postgresql-10 postgresql-client postgresql-client-common postgresql-common ) + + maas_snaps=( maas maas-test-db ) } remove_maas() { @@ -56,12 +58,21 @@ remove_maas() { done } +remove_maas_snap() { + sudo snap remove ${maas_snaps[@]} +} + install_maas() { # This is separate from the removal, so we can handle them atomically sudo apt-get -fuy --reinstall install "${core_packages}" "${maas_packages[@]}" "${pg_packages[@]}" sudo sed -i 's/DISPLAY_LIMIT=5/DISPLAY_LIMIT=100/' /usr/share/maas/web/static/js/bundle/maas-min.js } +install_maas_snap() { + sudo apt-get -fuy --reinstall install "${core_packages}" + sudo snap install ${maas_snaps[@]} --channel=$maas_version/stable +} + purge_admin_user() { read -r -d '' purgeadmin < clouds-"$rand_uuid".yaml <&2 - show_help - exit 1 - ;; + destroy_cloud "$OPTARG" + exit 0 + ;; + \? ) + printf "Unrecognized option: -%s. Valid options are:" "$OPTARG" >&2 + show_help + exit 1 + ;; : ) - printf "Option -%s needs an argument.\n" "$OPTARG" >&2 - show_help - echo "" - exit 1 + printf "Option -%s needs an argument.\n" "$OPTARG" >&2 + show_help + echo "" + exit 1 ;; esac done diff --git a/configs/asrock01.config b/configs/asrock01.config new file mode 100644 index 0000000..0f236ab --- /dev/null +++ b/configs/asrock01.config @@ -0,0 +1,7 @@ +hypervisor_name=asrock01 +hypervisor_ip=10.0.1.253 +hypervisor_mac="a8:a1:59:44:70:ac" + +external_ip=192.168.1.211 + +compute="as1-maas-node" diff --git a/configs/asrock02.config b/configs/asrock02.config new file mode 100644 index 0000000..f5aa3e9 --- /dev/null +++ b/configs/asrock02.config @@ -0,0 +1,7 @@ +hypervisor_name=asrock02 +hypervisor_ip=10.0.1.251 +hypervisor_mac="a8:a1:59:44:76:79" + +external_ip=192.168.1.212 + +compute="as2-maas-node" diff --git a/configs/asrock03.config b/configs/asrock03.config new file mode 100644 index 0000000..5822ce4 --- /dev/null +++ b/configs/asrock03.config @@ -0,0 +1,7 @@ +hypervisor_name=asrock03 +hypervisor_ip=10.0.1.250 +hypervisor_mac="" + +external_ip=192.168.1.213 + +compute="as3-maas-node" diff --git a/default.config b/configs/default.config similarity index 100% rename from default.config rename to configs/default.config diff --git a/configs/hp01.config b/configs/hp01.config new file mode 100644 index 0000000..c86f04e --- /dev/null +++ b/configs/hp01.config @@ -0,0 +1,14 @@ +hypervisor_name=hp01 +hypervisor_ip=10.0.1.252 +hypervisor_mac="e0:07:1b:ff:27:48" + +qemu_connection="qemu+ssh://virt@10.0.1.252/system" +qemu_password="5b5Bnev4kh3QeDGQ4KK8bVtX" +storage_path="/var/lib/vz/maas" + +external_ip=192.168.1.200 + +compute="hp1-maas-node" + +node_count=7 + diff --git a/asrock01.config b/configs/hypervisor.common.config similarity index 83% rename from asrock01.config rename to configs/hypervisor.common.config index 536c8fe..ec71d13 100644 --- a/asrock01.config +++ b/configs/hypervisor.common.config @@ -1,7 +1,3 @@ -hypervisor_name=asrock01 -hypervisor_ip=10.0.1.253 -hypervisor_mac="a8:a1:59:44:70:ac" - external_vlan=1 qemu_connection="qemu+ssh://virsh@${hypervisor_ip}/system" @@ -9,8 +5,6 @@ qemu_password="SgUoBByKjG9Lj78SwfWAHXD8DvgE67Cu" storage_path="/var/lib/libvirt/maas-images" -compute="as1-maas-node" - control_count=1 control_cpus=3 control_ram=8192 diff --git a/hypervisor.config b/configs/hypervisor.config similarity index 100% rename from hypervisor.config rename to configs/hypervisor.config diff --git a/maas.config b/configs/maas.config similarity index 100% rename from maas.config rename to configs/maas.config diff --git a/rpi4-maas.config b/configs/rpi4-maas.config similarity index 92% rename from rpi4-maas.config rename to configs/rpi4-maas.config index ecaa484..6dba2eb 100644 --- a/rpi4-maas.config +++ b/configs/rpi4-maas.config @@ -9,12 +9,12 @@ maas_pass="openstack" maas_profile="admin" maas_system_ip="192.168.1.10" maas_upstream_dns="1.1.1.1 4.4.4.4 8.8.8.8" -maas_user="maas" -maas_version="2.4" +maas_user="admin" +maas_version="2.8" maas_api_key="z9cT7jE3BhmxcXkWWN:ew5WW9QdDMg8TXVnjt:NtKgJdfgA5FVw2YT9CnaKU87wJ5fTxKa" no_proxy="localhost,127.0.0.1,$maas_system_ip" squid_proxy="http://192.168.100.10:3128" -virsh_user="ubuntu" +virsh_user="virsh" package_repository="http://$maas_bridge_ip:8765/mirror/ubuntu" snap_store_proxy="$squid_proxy" snap_store_assertions="" diff --git a/hp01.config b/examples/hypervisor.config.example.bridge similarity index 50% rename from hp01.config rename to examples/hypervisor.config.example.bridge index fe20c3a..426d332 100644 --- a/hp01.config +++ b/examples/hypervisor.config.example.bridge @@ -1,23 +1,18 @@ -qemu_connection="qemu+ssh://virt@10.0.1.252/system" -qemu_password="5b5Bnev4kh3QeDGQ4KK8bVtX" -storage_path="/var/lib/vz/maas" +qemu_connection="qemu+ssh://virsh@10.0.1.253/system" +qemu_password="seBGtkWFKZuFUFgig8NYU5uh" +storage_path="/var/lib/libvirt/maas-images" -compute="hp1-maas-node" +compute="maas-node" control_count=1 control_cpus=3 control_ram=8192 -node_count=7 +node_count=11 node_start=1 node_cpus=2 node_ram=4096 -disks=() -disks+=(50) -disks+=(20) -disks+=(20) - network_type=bridge bridges=() diff --git a/examples/hypervisor.config.example.network b/examples/hypervisor.config.example.network new file mode 100644 index 0000000..ba99667 --- /dev/null +++ b/examples/hypervisor.config.example.network @@ -0,0 +1,20 @@ +qemu_connection="qemu+ssh://virsh@10.0.1.253/system" +qemu_password="seBGtkWFKZuFUFgig8NYU5uh" +storage_path="/var/lib/libvirt/maas-images" + +compute="maas-node" + +control_count=1 +control_cpus=3 +control_ram=8192 + +node_count=11 +node_start=1 +node_cpus=2 +node_ram=4096 + +network_type=network + +networks=() +networks+=("maas") +networks+=("maas") diff --git a/maas.config.example b/examples/maas.config.example similarity index 100% rename from maas.config.example rename to examples/maas.config.example diff --git a/maas.debconf.example b/examples/maas.debconf.example similarity index 100% rename from maas.debconf.example rename to examples/maas.debconf.example diff --git a/functions.sh b/functions.sh new file mode 100644 index 0000000..4ae2d02 --- /dev/null +++ b/functions.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +# how long you want to wait for commissioning +# default is 1200, i.e. 20 mins +state_timeout=1200 + +install_deps() +{ + # Install some of the dependent packages + sudo apt -y update && sudo apt -y install jq bc virtinst + + # We install the snap, as maas-cli is not in distributions, this ensures + # that the package we invoke would be consistent + sudo snap install maas --channel=${maas_version}/stable +} + +# Ensures that any dependent packages are installed for any MAAS CLI commands +# This also logs in to MAAS, and sets up the admin profile +maas_login() +{ + # Login to MAAS using the API key and the endpoint + echo ${maas_api_key} | maas login ${maas_profile} ${maas_endpoint} - +} + +# Grabs the unique system_id for the host human readable hostname +maas_system_id() +{ + node_name=$1 + + maas ${maas_profile} machines read hostname=${node_name} | jq ".[].system_id" | sed s/\"//g +} + +# Based on the nodename, finds the pod id, if it exists +maas_pod_id() +{ + node_name=$1 + + maas ${maas_profile} pods read | jq ".[] | {pod_id:.id, hyp_name:.name}" --compact-output | \ + grep ${node_name} | jq ".pod_id" | sed s/\"//g +} + +machine_add_tag() +{ + system_id=$1 + tag=$2 + + # If the tag doesn't exist, then create it + if [[ $(maas ${maas_profile} tag read ${tag}) == "Not Found" ]] ; then + maas ${maas_profile} tags create name=${tag} + fi + + # Assign the tag to the machine + maas ${maas_profile} tag update-nodes ${tag} add=${system_id} +} + +# This takes the system_id, and ensures that the machine is in $state state +# You may want to tweak the commission_timeout above in somehow it's failing +# and needs to be done quicker +ensure_machine_in_state() +{ + system_id=$1 + state=$2 + + # TODO: add a $3 to be able to customise the timeout + # timout= if [[ $3 == "" ]] ; then state_timeout else $3 ; fi + timeout=${state_timeout} + + # The epoch time when this part started + time_start=$(date +%s) + + # variable that will be used to check against for the timeout + time_end=${time_start} + + # The initial state of the system + status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) + + # We will continue to check the state of the machine to see if it is in + # $state or the timeout has occured, which defaults to 20 mins + while [[ ${status_name} != "${state}" ]] && [[ $( echo ${time_end} - ${time_start} | bc ) -le ${timeout} ]] + do + # Check every 20 seconds of the state + sleep 20 + + # Grab the current state + status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) + + # Grab the current time to compare against + time_end=$(date +%s) + done +} + +read_config() +{ + configs="" + configs+=" configs/default.config" + configs+=" configs/maas.config" + configs+=" configs/hypervisor.common.config" + configs+=" configs/hypervisor.config" + + for config in $configs ; do + if [ ! -f $config ]; then + printf "Error: missing config file. Please create the file '$config'.\n" + exit 1 + else + shopt -s extglob + source "$config" + fi + done +} \ No newline at end of file diff --git a/manage-hypervisor-nodes.sh b/manage-hypervisor-nodes.sh index 90f8355..0590be8 100755 --- a/manage-hypervisor-nodes.sh +++ b/manage-hypervisor-nodes.sh @@ -1,50 +1,11 @@ #!/bin/bash # set -x - -. default.config -. maas.config -. hypervisor.config - -# how long you want to wait for commissioning -# default is 1200, i.e. 20 mins -commission_timeout=1200 +. functions.sh # Time between building VMs build_fanout=60 -# Ensures that any dependent packages are installed for any MAAS CLI commands -# This also logs in to MAAS, and sets up the admin profile -maas_login() -{ - # Install some of the dependent packages - sudo apt -y update && sudo apt -y install jq bc virtinst - - # We install the snap, as maas-cli is not in distributions, this ensures - # that the package we invoke would be consistent - sudo snap install maas --channel=2.8/stable - - # Login to MAAS using the API key and the endpoint - echo ${maas_api_key} | maas login ${maas_profile} ${maas_endpoint} - -} - -# Grabs the unique system_id for the host human readable hostname -maas_system_id() -{ - node_name=$1 - - maas ${maas_profile} machines read hostname=${node_name} | jq ".[].system_id" | sed s/\"//g -} - -maas_pod_id() -{ - node_name=$1 - - maas ${maas_profile} pods read | jq ".[] | {pod_id:.id, hyp_name:.name}" --compact-output | \ - grep ${node_name} | jq ".pod_id" | sed s/\"//g -} - - # Adds the VM into MAAS maas_add_node() { @@ -63,17 +24,9 @@ maas_add_node() # Grabs the system_id for th node that we are adding system_id=$(maas_system_id ${node_name}) - # This will ensure that the node is ready before we start manipulating - # other attributes. - ensure_machine_ready ${system_id} + ensure_machine_in_state ${system_id} "Ready" - # If the tag doesn't exist, then create it - if [[ $(maas ${maas_profile} tag read ${node_type}) == "Not Found" ]] ; then - maas ${maas_profile} tags create name=${node_type} - fi - - # Assign the tag to the machine - maas ${maas_profile} tag update-nodes ${node_type} add=${system_id} + machine_add_tag ${system_id} ${node_type} # Ensure that all the networks on the system have the Auto-Assign set # so that the all the of the networks on the host have an IP automatically. @@ -96,57 +49,43 @@ maas_assign_networks() subnet_line=$(maas admin subnets read | jq ".[] | {subnet_id:.id, vlan:.vlan.vid, vlan_id:.vlan.id}" --compact-output | grep "vlan\":$vlan,") maas_vlan_id=$(echo $subnet_line | jq .vlan_id | sed s/\"//g) maas_subnet_id=$(echo $subnet_line | jq .subnet_id | sed s/\"//g) + ip_addr="" if [[ $i -eq 0 ]] ; then vlan_int_id=${phys_int_id} mode="STATIC" ip_addr="ip_address=$hypervisor_ip" else - vlan_int=$(maas ${maas_profile} interfaces create-vlan ${system_id} vlan=${maas_vlan_id} parent=$phys_int_id) + vlan_int=$(maas ${maas_profile} interfaces create-vlan ${system_id} vlan=${maas_vlan_id} parent=$phys_int_id) vlan_int_id=$(echo $vlan_int | jq .id | sed s/\"//g) if [[ $vlan -eq $external_vlan ]] ; then - mode="DHCP" + mode="STATIC" + ip_addr="ip_address=$external_ip" else mode="AUTO" fi - ip_addr="" fi - bridge_int=$(maas ${maas_profile} interfaces create-bridge ${system_id} name=${bridges[$i]} vlan=$maas_vlan_id mac_address=${hypervisor_mac} parent=$vlan_int_id) + bridge_int=$(maas ${maas_profile} interfaces create-bridge ${system_id} name=${bridges[$i]} vlan=$maas_vlan_id mac_address=${hypervisor_mac} parent=$vlan_int_id) bridge_int_id=$(echo $bridge_int | jq .id | sed s/\"//g) bridge_link=$(maas ${maas_profile} interface link-subnet $system_id $bridge_int_id mode=${mode} subnet=${maas_subnet_id} ${ip_addr}) (( i++ )) done } -# This takes the system_id, and ensures that the machine is uin Ready state -# You may want to tweak the commission_timeout above in somehow it's failing -# and needs to be done quicker -ensure_machine_ready() -{ - system_id=$1 - - time_start=$(date +%s) - time_end=${time_start} - status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) - while [[ ${status_name} != "Ready" ]] && [[ $( echo ${time_end} - ${time_start} | bc ) -le ${commission_timeout} ]] - do - sleep 20 - status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) - time_end=$(date +%s) - done -} - # Calls the functions that destroys and cleans up all the VMs wipe_node() { + install_deps maas_login destroy_node } create_node() { + install_deps maas_login maas_add_node ${hypervisor_name} ${hypervisor_mac} physical } install_node() { + install_deps maas_login deploy_node } @@ -157,19 +96,15 @@ destroy_node() { maas ${maas_profile} pod delete ${pod_id} system_id=$(maas_system_id ${hypervisor_name}) - maas ${maas_profile} machine release ${system_id} maas ${maas_profile} machine delete ${system_id} } deploy_node() { system_id=$(maas_system_id ${hypervisor_name}) - #maas ${maas_profile} machine deploy ${system_id} install_kvm=true user_data="$(base64 user-data.yaml)" - maas ${maas_profile} machine deploy ${system_id} user_data="$(base64 user-data.yaml)" - # TODO: keep trying, until it gives a valid output - #until $(maas ${maas_profile} machine deploy ${system_id} install_kvm=true) ; do - # machine ${maas_profile} machine release ${system_id} + # Only return when the node has finised deploying + ensure_machine_in_state ${system_id} "Deployed" } show_help() { @@ -177,12 +112,14 @@ show_help() { -c Creates Hypervisor -w Removes Hypervisor - -i Install/Deploy Hypervisor + -d Deploy Hypervisor -a Create and Deploy " } -while getopts ":cwdi" opt; do +read_config + +while getopts ":cwia" opt; do case $opt in c) create_node @@ -190,7 +127,7 @@ while getopts ":cwdi" opt; do w) wipe_node ;; - i) + d) install_node ;; a) diff --git a/manage-maas-nodes.sh b/manage-maas-nodes.sh index 0740346..f64a01c 100755 --- a/manage-maas-nodes.sh +++ b/manage-maas-nodes.sh @@ -1,10 +1,7 @@ #!/bin/bash # set -x - -. default.config -. maas.config -. hypervisor.config +. functions.sh # Storage type storage_format="raw" @@ -13,36 +10,9 @@ storage_format="raw" nic_model="virtio" stg_bus="scsi" -# how long you want to wait for commissioning -# default is 1200, i.e. 20 mins -commission_timeout=1200 - # Time between building VMs build_fanout=60 -# Ensures that any dependent packages are installed for any MAAS CLI commands -# This also logs in to MAAS, and sets up the admin profile -maas_login() -{ - # Install some of the dependent packages - sudo apt -y update && sudo apt -y install jq bc virtinst - - # We install the snap, as maas-cli is not in distributions, this ensures - # that the package we invoke would be consistent - sudo snap install maas --channel=2.8/stable - - # Login to MAAS using the API key and the endpoint - echo ${maas_api_key} | maas login ${maas_profile} ${maas_endpoint} - -} - -# Grabs the unique system_id for the host human readable hostname -maas_system_id() -{ - node_name=$1 - - maas ${maas_profile} machines read hostname=${node_name} | jq ".[].system_id" | sed s/\"//g -} - # Adds the VM into MAAS maas_add_node() { @@ -64,17 +34,10 @@ maas_add_node() # Grabs the system_id for th node that we are adding system_id=$(maas_system_id ${node_name}) - # This will ensure that the node is ready before we start manipulating - # other attributes. - ensure_machine_ready ${system_id} - # If the tag doesn't exist, then create it - if [[ $(maas ${maas_profile} tag read ${node_type}) == "Not Found" ]] ; then - maas ${maas_profile} tags create name=${node_type} - fi + ensure_machine_in_state ${system_id} "Ready" - # Assign the tag to the machine - maas ${maas_profile} tag update-nodes ${node_type} add=${system_id} + machine_add_tag ${system_id} ${node_type} # Ensure that all the networks on the system have the Auto-Assign set # so that the all the of the networks on the host have an IP automatically. @@ -105,31 +68,15 @@ maas_auto_assign_networks() # Calls the 3 functions that creates the VMs create_vms() { + install_deps maas_login create_storage build_vms } -# This takes the system_id, and ensures that the machine is uin Ready state -# You may want to tweak the commission_timeout above in somehow it's failing -# and needs to be done quicker -ensure_machine_ready() -{ - system_id=$1 - - time_start=$(date +%s) - time_end=${time_start} - status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) - while [[ ${status_name} != "Ready" ]] && [[ $( echo ${time_end} - ${time_start} | bc ) -le ${commission_timeout} ]] - do - sleep 20 - status_name=$(maas ${maas_profile} machine read ${system_id} | jq ".status_name" | sed s/\"//g) - time_end=$(date +%s) - done -} - # Calls the functions that destroys and cleans up all the VMs wipe_vms() { + install_deps maas_login destroy_vms } @@ -301,6 +248,9 @@ show_help() { " } +# Initialise the configs +read_config + while getopts ":cwd" opt; do case $opt in c)