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


沒有留言:

張貼留言

【IT Notes】透過api移轉Gmail到Exchange

 在雲端裡面串接api不是一件很好學的技術,第一次有機會學習到將GWS的Gmail信件全部轉移到M365的Exchange,其實方法很多種,像以前用的pst檔匯出轉移的方式等,但透過api串接,可以批次和排程轉移,是非常方便且準確的作法。唯一讓人感到困難的是學習成本不小,通常需要...