Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Ansible Error: Decryption Failed – How to fix it quickly

by | Jul 5, 2021

Stuck with the Ansible Error: Decryption Failed? We can help you.

It frustrates us to get an error when we try to run an ansible-playbook.

As part of our Server Management Services, we assist our customers with several Ansible queries.

Today, let us see how we can fix this error.


Ansible Error: Decryption Failed

Recently, we had a customer who came across the following error:

fatal: []: FAILED! => {“msg”: “Decryption failed (no vault secrets were found that could decrypt) on /home/bobcares/ansible/encrypted_data.txt”}
fatal: []: FAILED! => {“msg”: “A vault password or secret must be specified to decrypt /home/bobcares/ansible/Bobcares/encrypted_data.txt”}

With Ansible Vault, we can encrypt files rather than leaving them visible as plaintext in playbooks.

Generally, we use it on sensitive information like passwords, SSL private keys, etc.

By default, to encrypt data, the Ansible vault uses the AES256 algorithm.

File before encryption :

$> cat encrypted_data.txt
This is an encrypted data

Encryption using Ansible Vault :

$ ansible-vault encrypt encrypted_data.txt
New Vault password:
Confirm New Vault password:
Encryption successful

After Encryption :

$ > cat encrypted_data.txt

Now it is safe to include as a parameter in the ansible-playbook.

In addition, we need to provide a decryption password when we run the ansible-playbook which contains a file encrypted with ansible vault.


Cause and Fix to the error

Moving ahead, let us see the cause and how our Support Techs fix this error.

Generally, we come across this error because the decryption password we provide to ansible is incorrect.

For example, consider a playbook for the encrypted_data.txt file which we used ansible vault to encrypt and copy over to a target machine after decryption.

vault.yml :

– hosts:
– name: Copying Encrypted file to target machine and decrypting
src: encrypted_data.txt
dest: /home/decrypted_data.txt

If we try to run the playbook directly like this:

ansible-playbook vault.yml

This will eventually end up in an error.

So, we have to provide the decryption password to the playbook, either as a prompt to the terminal or as a vault file.

ansible-playbook vault.yml –ask-vault-pass ## To prompt for vault password

ansible-playbook vault.yml –vault-password-file /home/bobcares/private/vault_pass.txt ## To automatically read the vault password

We use a convenient way to pass the vault password. The error disappears once we provide the correct password to the ansible controller.

[Need help with the fix? We’d be happy to assist]



To conclude, an incorrect decryption password can lead us to this error. Today, we saw how our Support Techs fix this error for our customers.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.