ansible-vault encrypt_string 's3cr3t-value' --name api_key

Category: IaC & Automation

ansible-vault encrypt_string 's3cr3t-value' --name api_key

Encrypt a single value for use in variables

Returns an encrypted blob you can paste as the api_key variable directly in a playbook or variable file, keeping the secret out of plaintext YAML. The value decrypts at runtime when the vault password is provided. Related: ansible-vault create secrets.yml.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.