- 使用 Ansible Galaxy 和要求文件 /home/student/ansible/roles/requirements.yml,
- 从以下 URL 下载角色并安装到 /home/student/ansible/roles:
任务要求
- 从链接下载角色并安装角色
- http://172.25.250.250/ansible2.8/haproxy.tar.gz 此角色的名称应当为 balancer
http://172.25.250.250/ansible2.8/phpinfo.tar.gz 此角色的名称应当为 phpinfo
[student@workstationansible]$ vim roles/requirements.yml
---
- name: balancer
src: http://172.25.250.250/ansible2.8/haproxy.tar.gz
- name: phpinfo
src: http://172.25.250.250/ansible2.8/files/phpinfo.tar.gz
[student@workstation ansible]$ ansible-galaxy install -r roles/requirements.yml -p roles/