From f3d6b0ae0e855f15121e3c950984232a2676c682 Mon Sep 17 00:00:00 2001 From: RadinPirouz Date: Wed, 11 Sep 2024 00:07:11 +0330 Subject: [PATCH] Update Ansible Vault Doc --- .../Ansible/5-Vault.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Configuration Management & Automation/Ansible/5-Vault.md b/Configuration Management & Automation/Ansible/5-Vault.md index 3b07dc8..fb74ab3 100644 --- a/Configuration Management & Automation/Ansible/5-Vault.md +++ b/Configuration Management & Automation/Ansible/5-Vault.md @@ -56,3 +56,37 @@ ansible-playbook main.yaml -i servers.ini --ask-vault-pass --become - **`--become`**: Ensures that the tasks are executed with elevated privileges (e.g., root). When you run the command, you will be prompted to enter the Vault password to decrypt `secret.yaml` and access the `password` variable. + +### 4. Additional Vault Commands + +- **Edit an existing encrypted file**: + + ```bash + ansible-vault edit secret.yaml + ``` + +- **Rekey (change the Vault password)**: + + ```bash + ansible-vault rekey secret.yaml + ``` + +- **View the contents of an encrypted file (without decrypting it)**: + + ```bash + ansible-vault view secret.yaml + ``` + +- **Decrypt a Vault file permanently**: + + ```bash + ansible-vault decrypt secret.yaml + ``` + +- **Encrypt a previously unencrypted file**: + + ```bash + ansible-vault encrypt secret.yaml + ``` + +Ansible Vault provides a powerful way to securely manage sensitive data in your automation processes. \ No newline at end of file