vault: update bitwarden plugin

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-09-20 15:16:27 +02:00
parent 8c19ec8e40
commit 85ffda1131
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
1 changed files with 3 additions and 0 deletions

View File

@ -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)