From c21de57d8716b4a33e26a63a7264af5c9e5c9798 Mon Sep 17 00:00:00 2001 From: Alexis Pentori Date: Fri, 20 Sep 2024 15:41:32 +0200 Subject: [PATCH] vault: update bitwarden plugin Signed-off-by: Alexis Pentori --- ansible/lookup_plugins/bitwarden.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/lookup_plugins/bitwarden.py b/ansible/lookup_plugins/bitwarden.py index d757ef0..1f27408 100755 --- a/ansible/lookup_plugins/bitwarden.py +++ b/ansible/lookup_plugins/bitwarden.py @@ -143,6 +143,7 @@ class Bitwarden(object): return json.loads(self.get_entry(key, 'item')) def get_notes(self, key): + print(f"{self._run(['get', key])}") return self.get_item(key).get('notes') def get_custom_field(self, key, field): @@ -188,6 +189,8 @@ class LookupModule(LookupBase): return values def lookup(self, term, kwargs): + if "Migrated to Vault" in self.bw.get_notes(term): + raise AnsibleError("Secret Migrated to Vault, please update Secret Source") if 'file' in kwargs: # Try attachments first itemid = self.bw.get_itemid(term)