2024年9月10日 星期二

【IT Notes】RHCE測驗第十六題 Rekey an Ansible vault

 Rekey an existing Ansible vault as follows:

【題前說明】

又是一個可以喘口氣的題目,此題只是要考對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


沒有留言:

張貼留言

【當兵回憶】八里連

 在我心目中新兵日記是天花板等級的軍教片,並不是說沒有比它更好的作品,只是因為它的在拍攝的背景和時間,也正是我在服兵役的同時,老婆很多次好奇問我,為什麼我總是放在YouTube的新兵日記直播,我都說我只放在有個聲音在,我沒有真正在看,但這行為仔細想想也好多年了吧!台詞聽到我都會背...