~/ansible/collections
。
[deyu1@kvm19 ansible]$ vim ansible.cfg [deyu1@kvm19 ansible]$ grep ^collection ansible.cfg collections_path=~/ansible/collections
~/ansible
中沒有 collections 次目錄。
[deyu1@kvm19 ansible]$ ll total 48 -rw-r--r--. 1 deyu1 deyu1 13 Feb 20 10:36 adhoc.txt -rw-r--r--. 1 deyu1 deyu1 38850 Feb 20 18:34 ansible.cfg -rw-r--r--. 1 deyu1 deyu1 129 Feb 18 10:49 inventory drwxr-xr-x. 2 deyu1 deyu1 6 Feb 18 11:32 roles
[deyu1@kvm19 ansible]$ ansible-galaxy collection install \ http://dywang.csie.cyut.edu.tw/materials/mynmspace-mycollect-1.0.0.tar.gz Downloading http://dywang.csie.cyut.edu.tw/materials/mynmspace-mycollect-1.0.0.tar.gz to /home/deyu1/.ansible/tmp/ansible-local-22956ce4nf82/tmp2k57mqnm/mynmspace-mycollect-1.0.0-89_b1sqk Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'mynmspace.mycollect:1.0.0' to '/home/deyu1/ansible/collections/ansible_collections/mynmspace/mycollect' mynmspace.mycollect:1.0.0 was installed successfully
~/ansible/collections/
,不用先建目錄 ~/ansible/collections
,安裝時會自動產生。
[deyu1@kvm19 ansible]$ ansible-galaxy collection list # /home/deyu1/ansible/collections/ansible_collections Collection Version ------------------- ------- mynmspace.mycollect 1.0.0
~/ansible/collections
下安裝的內容集檔案。
[deyu1@kvm19 ansible]$ tree collections/ collections/ └── ansible_collections └── mynmspace └── mycollect ├── docs ├── FILES.json ├── MANIFEST.json ├── plugins │ └── README.md ├── README.md └── roles 6 directories, 4 files