Ansible Galaxy是一个Ansible内容公共资源库,类似程序员使用的 github,docker 镜像仓库,yum仓库和deb仓库等。可以将自己编写的 Role 通过 Galaxy 这个平台进行分享。同样,我们也可以通过 Galaxy 这个平台去获取一些我们想要的 Role。
Ansible Galaxy的官方网站是:(https://galaxy.ansible.com/)
[root@localhost roles]# ansible-galaxy role init test2
- Role test2 was created successfully
[root@localhost roles]# tree test2
test2
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
8 directories, 8 files
# -p 指定移除角色的路径
[root@localhost roles]# ansible-galaxy role remove test2 -p ./
- successfully removed test2