1.Ansible Galaxy是Ansible的一个官方社区,用于共享角色和功能代码,用户可以在网站自由地共享和下载Ansible角色。
![图片[1]-9.4.2从外部环境获取角色-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片3-1024x570.png)
![图片[2]-9.4.2从外部环境获取角色-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片4-1024x573.png)
2.编写一个YAML语言格式的文件,指明网址链接和角色名称,然后再用-r参数加载
[root@dsrw ~]# vim nginx.yml
---
- src: https://galaxy.ansible.com/download/nginxinc-nginx_core-0.7.1.tar.gz
name: nginx-core
[root@dsrw ~]# ansible-galaxy install -r nginx.yml
- downloading role from https://galaxy.ansible.com/download/nginxinc-nginx_core-0.7.1.tar.gz
- extracting nginx-core to /root/.ansible/roles/nginx-core
- nginx-core was installed successfully
[root@dsrw ~]#ansible-galaxy list
# /root/.ansible/roles
- nginx_core, (unknown version)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容