環境配置請參考第0章環境配置喔 ~~
Ansible 模擬考第五題,下載線上資源並安裝 Roles
- 編輯 /home/student/ansible/roles/list.yml 將下方兩個連結下載並透過 Role ,並存放在 /home/student/ansible/roles/ 內,其名稱要求如下:
1. 下載 https://jeffwen0105.github.io/Ansible/exam/howhow-haproxy.tar ,
並指定 roles 名稱為 nlb
2. 下載 https://jeffwen0105.github.io/Ansible/exam/howhow-phpinfo.tar ,
並指定 roles 名稱為 info
考題解答
- 編輯 list.yml
- src: https://jeffwen0105.github.io/Ansible/exam/howhow-haproxy.tar
name: nlb
- src: https://jeffwen0105.github.io/Ansible/exam/howhow-phpinfo.tar
name: info
- 透過 ansible-galaxy 指令安裝
ansible-galaxy role install -r roles/list.yml -p roles

- 執行完後會產生 info 跟 nlb 兩個目錄後即可
