Open chendelin1982 opened 2 years ago
ansible-galaxy collection init websoft9.mysql
[root@iZj6c0zfkuoye7ynl2c5mfZ nginx]# tree websoft9
websoft9
└── mysql
├── docs
├── galaxy.yml
├── plugins
│ └── README.md
├── README.md
└── roles
[root@iZj6c0zfkuoye7ynl2c5mfZ nginx]# ansible-galaxy role init test_role
[root@iZj6c0zfkuoye7ynl2c5mfZ nginx]# tree test_role
test_role
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
[root@iZj6c7cj31hijkg5cfonobZ ~]# ansible-galaxy init --type apb ansible-test
[root@iZj6c7cj31hijkg5cfonobZ ~]# tree ansible-test/
ansible-test/
├── apb.yml
├── defaults
│ └── main.yml
├── Dockerfile
├── files
├── handlers
│ └── main.yml
├── Makefile
├── meta
│ └── main.yml
├── playbooks
│ ├── deprovision.yml
│ └── provision.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── ansible.cfg
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
补充一点,role是可以依赖其他远程role的,但是实验一直没成功
how to pubulish a self collection? e.g. namaspace:qiaofeng1227 collection:owncloud
ansible-galaxy collection init qiaofeng1227.owncloud
add meta/runtime.yml
[root@iZj6c7cj31hijkg5cfonobZ owncloud]# cat meta/runtime.yml
requires_ansible: ">=2.9"
[root@iZj6c7cj31hijkg5cfonobZ owncloud]#ansible-galaxy collection build
[root@iZj6c7cj31hijkg5cfonobZ owncloud]# ls
docs galaxy.yml meta plugins qiaofeng1227-owncloud-1.0.0.tar.gz README.md roles
ansible-galaxy collection publish qiaofeng1227-owncloud-1.0.0.tar.gz --api-key XXXX
即使是没有role,plugin,module,playbook,也可以发布成功。
Collection 用途
Collection 用途
目标
满足 Docker 类应用可以快速生产镜像
需求
设计