From c6ed3e84725e19798e163399bc1d210e58238bd7 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Thu, 12 Jan 2017 23:36:39 +0300 Subject: [PATCH] move prompts to the algo script --- algo | 26 +++++++++++++++++++++++++- users.yml | 24 ------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/algo b/algo index 26fbbd22..4b1c5126 100755 --- a/algo +++ b/algo @@ -332,7 +332,31 @@ Enter the number of your desired provider } user_management () { - ansible-playbook users.yml + + read -p " +Enter IP address of your server: (use localhost for local installation) +: " -r server_ip + + read -p " +What user should we use to login on the server? (ignore if you're deploying to localhost) +[root]: " -r server_user + server_user=${server_user:-root} + +read -p " +Do you want each user to have their own account for SSH tunneling? +[y/N]: " -r ssh_tunneling_enabled +ssh_tunneling_enabled=${ssh_tunneling_enabled:-n} + + read -p " +Enter the public IP address of your server: (IMPORTANT! This IP is used to verify the certificate) +: " -r IP_subject + + read -p " +Enter the password for the private CA key: +[pasted values will not be displayed] +: " -rs easyrsa_CA_password + +ansible-playbook users.yml -e "server_ip=$server_ip server_user=$server_user ssh_tunneling_enabled=$ssh_tunneling_enabled IP_subject=$IP_subject easyrsa_CA_password=$easyrsa_CA_password" } case "$1" in diff --git a/users.yml b/users.yml index 4064d7bd..689e935d 100644 --- a/users.yml +++ b/users.yml @@ -4,30 +4,6 @@ gather_facts: False vars_files: - config.cfg - vars_prompt: - - - name: "server_ip" - prompt: "Enter IP address of your server: (use localhost for local installation)\n" - default: localhost - private: no - - - name: "server_user" - prompt: "What user should we use to login on the server? (ignore if you're deploying to localhost):\n" - default: "root" - private: no - - - name: "ssh_tunneling_enabled" - prompt: "Do you want each user to have their own account for SSH tunneling? (y/n):\n" - default: "n" - private: no - - - name: "IP_subject" - prompt: "Enter public IP address of your server: (IMPORTANT! This IP is used to verify the certificate)\n" - private: no - - - name: "easyrsa_CA_password" - prompt: "Enter the password for the private CA key:\n" - private: yes tasks: - name: Add the server to the vpn-host group