Fixed a couple of bugs in the TUI like not properly fetching the size of the vpc_arr, or removing the prefix/suffix markers for Ansible's blockinfile from the SSH key
This commit is contained in:
@@ -21,6 +21,13 @@
|
|||||||
blockinfile:
|
blockinfile:
|
||||||
path: "{{ ansible_env.HOME }}/.ssh/{{ ssh_key_name }}.pem"
|
path: "{{ ansible_env.HOME }}/.ssh/{{ ssh_key_name }}.pem"
|
||||||
block: "{{ aws_key_pair.key.private_key }}"
|
block: "{{ aws_key_pair.key.private_key }}"
|
||||||
|
marker: ""
|
||||||
|
|
||||||
|
- name: Remove the blank lines from blockinfile module
|
||||||
|
lineinfile:
|
||||||
|
path: "{{ ansible_env.HOME }}/.ssh/{{ ssh_key_name }}.pem"
|
||||||
|
state: absent
|
||||||
|
regexp: '^$'
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- "'destroy' not in ansible_run_tags"
|
- "'destroy' not in ansible_run_tags"
|
||||||
|
|||||||
+10
-10
@@ -62,6 +62,16 @@ initialize-environment() {
|
|||||||
main-menu
|
main-menu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prompt-for-vpc-id() {
|
||||||
|
readarray -t vpc_arr < <(aws ec2 describe-vpcs | jq -r '.Vpcs[] | "\(.VpcId) \((.Tags[]? | select(.Key | contains("Name")) | .Value) // "")"' | awk '{print($1, $2 == "" ? "-" : $2);}')
|
||||||
|
declare prompt=""
|
||||||
|
for item in "${vpc_arr[@]}"; do
|
||||||
|
prompt+="$item OFF "
|
||||||
|
done
|
||||||
|
|
||||||
|
VPC_ID=$(whiptail --fb --title "Select VPC" --radiolist "Select which VPC to use to deploy resources into" "$BOX_HEIGHT" "$BOX_WIDTH" "${#vpc_arr[@]}" $prompt 3>&2 2>&1 1>&3)
|
||||||
|
}
|
||||||
|
|
||||||
deploy-and-run-benchmarkers() {
|
deploy-and-run-benchmarkers() {
|
||||||
declare title="Deploy and Run Benchmarkers"
|
declare title="Deploy and Run Benchmarkers"
|
||||||
|
|
||||||
@@ -213,16 +223,6 @@ custom-selections() {
|
|||||||
main-menu
|
main-menu
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt-for-vpc-id() {
|
|
||||||
readarray -t vpc_arr < <(aws ec2 describe-vpcs | jq -r '.Vpcs[] | "\(.VpcId) \((.Tags[]? | select(.Key | contains("Name")) | .Value) // "")"' | awk '{print($1, $2 == "" ? "-" : $2);}')
|
|
||||||
declare prompt=""
|
|
||||||
for item in "${vpc_arr[@]}"; do
|
|
||||||
prompt+="$item OFF "
|
|
||||||
done
|
|
||||||
|
|
||||||
VPC_ID=$(whiptail --fb --title "Select VPC" --radiolist "Select which VPC to use to deploy resources into" "$BOX_HEIGHT" "$BOX_WIDTH" "${vpc_arr[@]}" $prompt 3>&2 2>&1 1>&3)
|
|
||||||
}
|
|
||||||
|
|
||||||
main-menu() {
|
main-menu() {
|
||||||
declare choice
|
declare choice
|
||||||
choice=$(whiptail --fb --title "DynamoDB + DAX Benchmarker" --menu "Select an action" "$BOX_HEIGHT" "$BOX_WIDTH" 7 \
|
choice=$(whiptail --fb --title "DynamoDB + DAX Benchmarker" --menu "Select an action" "$BOX_HEIGHT" "$BOX_WIDTH" 7 \
|
||||||
|
|||||||
Reference in New Issue
Block a user