install/remove

  1. install 從網站下載角色並安裝。
    [deyu1@kvm19 ansible]$ ansible-galaxy install ansiblebit.haproxy
    - downloading role 'haproxy', owned by ansiblebit
    - downloading role from https://github.com/ansiblebit/haproxy/archive/master.tar.bz2
    - extracting ansiblebit.haproxy to /home/deyu1/ansible/roles/ansiblebit.haproxy
    - ansiblebit.haproxy (master) was installed successfully
    
  2. ansible-galaxy list 列出 ansiblebit.haproxy 角色。
    [deyu1@kvm19 ansible]$ ansible-galaxy list | grep ansiblebit
    - ansiblebit.haproxy, master
    
  3. 查詢 roles 目錄新增了 ansiblebit.haproxy 目錄,目錄內有角色的各種檔案。
    [deyu1@kvm19 ansible]$ ll roles/ansiblebit.haproxy/
    total 44
    drwxrwxr-x. 2 deyu1 deyu1 4096 Mar 11 11:00 defaults
    drwxrwxr-x. 2 deyu1 deyu1 4096 Mar 11 11:00 handlers
    -rw-rw-r--. 1 deyu1 deyu1 1479 Jun 23  2016 LICENSE
    drwxrwxr-x. 2 deyu1 deyu1 4096 Mar 11 11:00 meta
    -rw-rw-r--. 1 deyu1 deyu1  298 Jun 23  2016 NOTICE.md
    -rw-rw-r--. 1 deyu1 deyu1 2524 Jun 23  2016 README.md
    -rw-rw-r--. 1 deyu1 deyu1    0 Jun 23  2016 requirements.yml
    drwxrwxr-x. 2 deyu1 deyu1 4096 Mar 11 11:00 tasks
    drwxrwxr-x. 3 deyu1 deyu1 4096 Mar 11 11:00 templates
    drwxrwxr-x. 7 deyu1 deyu1 4096 Mar 11 11:00 tests
    -rw-rw-r--. 1 deyu1 deyu1  369 Jun 23  2016 tox.ini
    drwxrwxr-x. 2 deyu1 deyu1 4096 Mar 11 11:00 vars
    
  4. remove 移除角色 ansiblebit.haproxy。
    [deyu1@kvm19 ansible]$ ansible-galaxy remove ansiblebit.haproxy
    - successfully removed ansiblebit.haproxy
    
  5. ansible-galaxy list 沒有列出 ansiblebit.haproxy 角色。
    [deyu1@kvm19 ansible]$ ansible-galaxy list | grep ansiblebit
    
  6. 查詢 roles 目錄,ansiblebit.haproxy 目錄已被刪除。
    [deyu1@kvm19 ansible]$ ll roles/
    total 4
    drwxrwxr-x. 4 deyu1 deyu1 4096 Mar  9 11:11 apache