Commit d4357578 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[feature] add option to ask vault pass on frontend

Our CI playbook requires a vault pass. Add an option to have ansible on
the frontend side to ask for this vault pass.

Note that the output asking for the pass doesn't appear on stdout, but
it still works.
parent 4b3a6f50
......@@ -220,7 +220,11 @@ def do_configure(argv):
# call the remote ansible
remote_cmd = ('cd ansible;'
'ansible-playbook -i inventory.yaml ' + playpath)
'ansible-playbook -i inventory.yaml'
if argv.vault:
remote_cmd += ' --ask-vault-pass'
remote_cmd += ' ' + playpath
# forward agent, auto accept host, don't save it in the host file
cmd = ["ssh", "-A", "-oUserKnownHostsFile=/dev/null",
"-oStrictHostKeyChecking=no", "cc@" + public_ip, remote_cmd]
......@@ -263,6 +267,8 @@ def main():
parser_config = subparsers.add_parser("configure",
help="Configure an appliance")
parser_config.add_argument("--vault", action='store_true',
help="Ask for vault password on frontend play")
parser_config.add_argument("name", help="Name of the appliance")
parser_config.add_argument("playbook", default="main.yaml", nargs='?',
help="Playbook for remote configuration")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment