Fix ansible-console always asking for vault passwords

ansible-console was calling setup_vault_secrets
twice. Once directly and once via _play_prereqs()

The direct invocation was not setting auto_prompt=False.

However, the direct invocation isn't need at all so
this removes it so only _play_reqs() is used.
That fixes the unrequested vault password
prompting.

Fixes #33027

(cherry picked from commit 810fa7046b)
This commit is contained in:
Adrian Likins 2018-02-15 10:52:04 -05:00 committed by Brian Coca
parent 57bccd10af
commit f00dd99ea2

View file

@ -417,15 +417,6 @@ class ConsoleCLI(CLI, cmd.Cmd):
self.loader, self.inventory, self.variable_manager = self._play_prereqs(self.options)
default_vault_ids = C.DEFAULT_VAULT_IDENTITY_LIST
vault_ids = self.options.vault_ids
vault_ids = default_vault_ids + vault_ids
vault_secrets = self.setup_vault_secrets(self.loader,
vault_ids=vault_ids,
vault_password_files=self.options.vault_password_files,
ask_vault_pass=self.options.ask_vault_pass)
self.loader.set_vault_secrets(vault_secrets)
hosts = CLI.get_host_list(self.inventory, self.options.subset, self.pattern)
self.groups = self.inventory.list_groups()