Create an Ansible vault to store user passwords as follows:
The name of the vault is /home/student/ansible/locker.yml
The vault contains two variables with names:
- pw_developer with value Imadev
- pw_manager with value Imamgr
The password to encrypt and decrypt the vault is retent
The password is stored in the file /home/student/ansible/secret.txt
【題前說明】
這題要是給喘口氣用的,因為前後兩題都是較難的題型。主要重點是先建立一個secret.txt檔,裡面放的是密碼是retent,再來建立個locker.yml檔,裡面內容是一對變數檔,目的是為了提供後面的另一個題目解題使用,所以看起來簡單,可是若做不出來或錯誤的話,另一題也就會跟著報銷。經過ansible-valut指令會將locker.yml加密,必須要用到secret.txt才能夠解密,雖然簡單但也考驗加密的觀念。