Sistemata versione dello script per la creazione della chiave per il vault.
This commit is contained in:
parent
0faf2f2ef4
commit
8dff62b115
@ -11,11 +11,11 @@ from os import makedirs, path
|
||||
key = MD5.new(gethostname()).digest()
|
||||
cipher = AES.new(key, AES.MODE_ECB)
|
||||
base64enc = get("http://{{ serverfqdn }}:3000/vaultpass")
|
||||
encrypted = b64decode(base64enc)
|
||||
encrypted = b64decode(base64enc.content)
|
||||
longpass = cipher.decrypt(encrypted)
|
||||
|
||||
if not path.exists('/root/.ansible'):
|
||||
makedirs('/root/.ansible')
|
||||
|
||||
with open('/root/.ansible/vault.txt', 'w') as vaultfile:
|
||||
with open('/root/.ansible/vault.txt', 'w+') as vaultfile:
|
||||
vaultfile.write(longpass.strip('x'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user