diff --git a/lib/ansible/cli/vault.py b/lib/ansible/cli/vault.py index 762ba82b983..29b5404974d 100644 --- a/lib/ansible/cli/vault.py +++ b/lib/ansible/cli/vault.py @@ -184,6 +184,10 @@ class VaultCLI(CLI): vault_password_files=self.options.vault_password_files, ask_vault_pass=self.options.ask_vault_pass, create_new_password=True) + + if len(vault_secrets) > 1: + raise AnsibleOptionsError("Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.") + if not vault_secrets: raise AnsibleOptionsError("A vault password is required to use Ansible's Vault")