mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
add vars_prompt to playbooks
- this allows some vars to be prompted for at the start of the playbook setup - defaults to no output since this would mostly be used for passwords
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
import utils
|
||||
import sys
|
||||
import getpass
|
||||
|
||||
#######################################################
|
||||
|
||||
@@ -176,6 +177,12 @@ class PlaybookCallbacks(object):
|
||||
def on_task_start(self, name, is_conditional):
|
||||
print utils.task_start_msg(name, is_conditional)
|
||||
|
||||
def on_vars_prompt(self, varname, private=True):
|
||||
msg = 'input for %s: ' % varname
|
||||
if private:
|
||||
return getpass.getpass(msg)
|
||||
return raw_input(msg)
|
||||
|
||||
def on_setup_primary(self):
|
||||
print "SETUP PHASE ****************************\n"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user