Red_Hat
EX294 · Question #16
16. Update Ansible Vault Key Update the key for an existing Ansible Vault according to the following instructions: - The current vault password is insecure8sure - The new vault password is…
The task requires updating the encryption key for an existing Ansible vault from a given current password to a specified new password, while maintaining its encrypted state.
Submitted by ashley.k· Apr 18, 2026Deploy, Configure, and Manage Systems
Question
- Update Ansible Vault Key Update the key for an existing Ansible Vault according to the following instructions: - The current vault password is insecure8sure - The new vault password is bbs2you9527 - Keep the vault encrypted with the new password Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: [greg@control ansible]$ ansible-vault rekey --ask-vault-pass salaries.yml Vault password:
insecure8sureNew Vault password:bbs2you9527Confirm New Vault password:bbs2you9527Rekey successful [greg@control ansible]$ ansible-vault view salaries.yml Vault password:bbs2you9527haha # Verification: Decrypting and Viewing Content with the New Password (Required Step) [greg@control ansible]$ ansible-vault view --ask-vault-pass salaries.yml Vault password:bbs2you9527haha Create a playbook named /home/greg/ansible/cron.yml: - The playbook runs on managed nodes in the test host group - Configure a cron job that runs every 2 minutes and executes the following command: logger "EX200 in progress", running as user natasha Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: [greg@control ansible]$ ansible-doc -l | grep cron [greg@control ansible]$ ansible-doc cron [greg@control ansible]$ vim /home/greg/ansible/cron.yml --- - name: cron hosts: test tasks: - name: cron job cron: name: "cron job1" minute: "*/2" job: 'logger "EX200 in progress"' user: natasha [greg@control ansible]$ ansible-navigator run cron.yml -m stdout # Validation: Verify if the task exists and is correct with the command crontab -l -u natasha. (mandatory operation) [greg@control ansible]$ ansible test -a 'crontab -l -u natasha' node2 | CHANGED | rc=0 >> #Ansible: check dirs */2 * * * * logger "EX200 in progress"
Explanation
The task requires updating the encryption key for an existing Ansible vault from a given current password to a specified new password, while maintaining its encrypted state.
Concept tested. Rekeying Ansible vaults
Reference. https://docs.ansible.com/ansible/latest/user_guide/vault.html#rekeying-vaulted-files
Topics
#Ansible Vault#Playbook Creation#Cron Module#System Configuration
Community Discussion
No community discussion yet for this question.