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


沒有留言:

張貼留言

寒風中的CCNA之路

難得三月天還會寒流來襲,這周除了去台南參加活動之外,禮拜一我還去了恆逸參加CCNA考試,一寫完交卷之後,很快就知道成績,雖然外面很冷,但第一次覺得這天氣冷的還有點開心的心情。