nerdexam
Red_Hat

EX294 · Question #14

Following the instructions below, create an Ansible vault to store user passwords: - The vault name is /home/greg/ansible/locker.yml - The vault contains two variables with the following names…

The task involves creating an Ansible vault named /home/greg/ansible/locker.yml to securely store two specified user passwords, with the vault password stored in /home/greg/ansible/secret.txt.

Submitted by marco_it· Apr 18, 2026Manage Variables, Facts, and Content

Question

Following the instructions below, create an Ansible vault to store user passwords: - The vault name is /home/greg/ansible/locker.yml - The vault contains two variables with the following names: pw_developer, with the value Imadev pw_manager, with the value Imamgr - The password used to encrypt and decrypt the vault is whenyouwishuponastar - The vault is stored in the file /home/greg/ansible/secret.txt Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: [greg@control ansible]$ vim ansible.cfg ... vault_password_file = /home/greg/ansible/secret.txt [greg@control ansible]$ echo whenyouwishuponastar > /home/greg/ansible/secret.txt [greg@control ansible]$ ansible-vault create /home/greg/ansible/locker.yml --- pw_developer: Imadev pw_manager: Imamgr [greg@control ansible]$ ansible-vault view /home/greg/ansible/locker.yml --- pw_developer: Imadev pw_manager: Imamgr # Verification: Verify that the file content is encrypted using the recommended commands, and ensure that the file can be automatically decrypted by the configuration file secret.txt. (mandatory operation) [greg@control ansible]$ cat /home/greg/ansible/locker.yml $ANSIBLE_VAULT;1.1;AES256 3863666662376132653636383666306664633665636166366465323533396130663431393932663 1 3038366162383733643633383935663431376163646639350a39343666356636663130306465393 3 6337303063633334336262313065363336363033646164626236323964333535346665353464313 5 6162383733353561640a38333362313764656566663636306434336134653739663365323430626 3 3332613836613538343064376365393166373865663339393334346661623533363138343137313 5 666161303763323761383731343138373166653730613932343

Explanation

The task involves creating an Ansible vault named /home/greg/ansible/locker.yml to securely store two specified user passwords, with the vault password stored in /home/greg/ansible/secret.txt.

Concept tested. Creating and managing Ansible vaults

Reference. https://docs.ansible.com/ansible/latest/user_guide/vault.html#creating-new-vaulted-files

Topics

#Ansible Vault#Secret Management#ansible.cfg#Command Line Interface

Community Discussion

No community discussion yet for this question.

Full EX294 Practice