|
|
@ -19,7 +19,6 @@
|
|
|
|
#######################################################
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import getpass
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
import ansible.playbook
|
|
|
|
import ansible.playbook
|
|
|
@ -93,13 +92,9 @@ def main(args):
|
|
|
|
sudopass = None
|
|
|
|
sudopass = None
|
|
|
|
if not options.listhosts and not options.syntax and not options.listtasks:
|
|
|
|
if not options.listhosts and not options.syntax and not options.listtasks:
|
|
|
|
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
|
|
|
|
options.ask_pass = options.ask_pass or C.DEFAULT_ASK_PASS
|
|
|
|
if options.ask_pass:
|
|
|
|
|
|
|
|
sshpass = getpass.getpass(prompt="SSH password: ")
|
|
|
|
|
|
|
|
options.ask_sudo_pass = options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
|
|
|
|
options.ask_sudo_pass = options.ask_sudo_pass or C.DEFAULT_ASK_SUDO_PASS
|
|
|
|
if options.ask_sudo_pass:
|
|
|
|
( sshpass, sudopass ) = utils.ask_passwords(ask_pass=options.ask_pass, ask_sudo_pass=options.ask_sudo_pass)
|
|
|
|
sudopass = getpass.getpass(prompt="sudo password: ")
|
|
|
|
if options.sudo_user or options.ask_sudo_pass:
|
|
|
|
options.sudo = True
|
|
|
|
|
|
|
|
if options.sudo_user:
|
|
|
|
|
|
|
|
options.sudo = True
|
|
|
|
options.sudo = True
|
|
|
|
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
|
|
|
|
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
|
|
|
|
extra_vars = utils.parse_kv(options.extra_vars)
|
|
|
|
extra_vars = utils.parse_kv(options.extra_vars)
|
|
|
|