Rekey an existing Ansible vault as follows:
Download the Ansible vault from http://example.classroom.com/cd/exam_rhce8/salaries.yml to /home/student/ansible
The current vault password is retent
The new vault password is redhat
The vault remains in an encrypted state with the new password
【題前說明】
又是一個可以喘口氣的題目,此題只是要考對ansible-vault指令是否熟悉,只需要去data主機把要求的路徑檔案先下載好,然後重新配置檔案的密碼,沒有太多困難的操作,跟上一題比輕鬆很多。
一.解題過程:
[student@control ansible]$ wget http://example.classroom.com/cd/exam_rhce8/salaries.yml
[student@control ansible]$ ansible-vault rekey salaries.yml
Vault password: retent
New Vault password: redhat
Confirm New Vault password: redhat
Rekey successful
二.驗證結果
[student@control ansible]$ ansible-vault view salaries.yml
Vault password: redhat
三.恢復解題前的環境
[student@workstation ansible]$ vim 16-lab-rekey-stop.yml
---
- name: remove salaries.yml
hosts: 127.0.0.1
tasks:
- name: remove salaries.yml
file:
path: /home/student/ansible/salaries.yml
state: absent
[student@workstation ansible]$ ansible-playbook 16-lab-rekey-stop.yml
沒有留言:
張貼留言