You can also deport your password storage to any password manager. For example, to retrieve a password that would be stored in the rundeck vault:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib.request
import io
import ssl
def get_password():
'''
:return: Vault password
:return_type: str
'''
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = 'https://rundeck.rockylinux.org/api/11/storage/keys/ansible/vault'
req = urllib.request.Request(url, headers={
'Accept': '*/*',
'X-Rundeck-Auth-Token': '****token-rundeck****'
})
response = urllib.request.urlopen(req, context=ctx)
return response.read().decode('utf-8')
if __name__ == '__main__':
print(get_password())