diff --git a/ansible/roles/deploy_cdk/tasks/main.yml b/ansible/roles/deploy_cdk/tasks/main.yml index 3938940..870a8da 100644 --- a/ansible/roles/deploy_cdk/tasks/main.yml +++ b/ansible/roles/deploy_cdk/tasks/main.yml @@ -21,6 +21,13 @@ blockinfile: path: "{{ ansible_env.HOME }}/.ssh/{{ ssh_key_name }}.pem" 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: - "'destroy' not in ansible_run_tags" diff --git a/benchmarker.sh b/benchmarker.sh index 05f5b96..2ddd83a 100755 --- a/benchmarker.sh +++ b/benchmarker.sh @@ -62,6 +62,16 @@ initialize-environment() { 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() { declare title="Deploy and Run Benchmarkers" @@ -213,16 +223,6 @@ custom-selections() { 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() { declare choice choice=$(whiptail --fb --title "DynamoDB + DAX Benchmarker" --menu "Select an action" "$BOX_HEIGHT" "$BOX_WIDTH" 7 \