diff options
Diffstat (limited to '_support/terraform/create-demo-cluster')
-rwxr-xr-x | _support/terraform/create-demo-cluster | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/_support/terraform/create-demo-cluster b/_support/terraform/create-demo-cluster index 4c59c9163..e2d8c681e 100755 --- a/_support/terraform/create-demo-cluster +++ b/_support/terraform/create-demo-cluster @@ -3,6 +3,7 @@ require 'erb' require 'etc' +require 'io/console' require_relative 'helper.rb' @@ -29,6 +30,14 @@ def praefect_demo_cluster_name get_input('Enter a name for your demo cluster', default_name) end +def praefect_sql_password + get_input( + 'Enter a password for the praefect PostgreSQL user', + 'PRAEFECT_SQL_PASSWORD', + echo: false + ) +end + def username Etc.getlogin end @@ -46,11 +55,12 @@ def ssh_pubkey pubkey end -def get_input(prompt, default) +def get_input(prompt, default, echo: true) puts "#{prompt} (default: #{default})." print "> " - input = gets.chomp + input = echo ? gets.chomp : STDIN.noecho(&:gets).chomp + input.empty? ? default : input end |