Skip to content
Snippets Groups Projects
Commit 18ff3195 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Fix bug trying to decrypt a plaintext file"

parents 64a76166 c81d9e8b
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,12 @@ def vault_encrypt(module, file_path):
def vault_decrypt(module, file_path):
"""Decrypt a file using Ansible vault"""
# Return immediately if file not encrypted
with open(file_path, 'r') as f:
if not f.readline()[:15] == "$ANSIBLE_VAULT;":
return
password_path = create_vault_password_file(module)
try:
cmd = ["ansible-vault", "decrypt",
......
---
fixes:
- |
Fixes an error when generating passwords.yml if an unencrypted file exists
but a password has been supplied.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment