18 lines
485 B
Python
Executable File
18 lines
485 B
Python
Executable File
#!/usr/bin/python3
|
|
#-*- coding: utf-8 -*-
|
|
|
|
import hvac
|
|
import os
|
|
|
|
hostname=os.sys.argv[1]
|
|
|
|
str_url = "http://10.10.43.240:30803"
|
|
client = hvac.Client(url=str_url)
|
|
client.auth.approle.login(role_id="e96c5fd8-abde-084a-fde7-7450a9348a70", secret_id="5371706b-414a-11d3-f3fd-6cf98871aad1")
|
|
|
|
try:
|
|
data = client.secrets.kv.v2.read_secret_version(mount_point='host', path=hostname, raise_on_deleted_version=True)['data']['data']
|
|
print(data)
|
|
except Exception as err:
|
|
print(err)
|