24. 怎麼搜尋 Roles?
24
# ansible-galaxy [delete|import|info|init|install|list|login|remove|search|setup]
[--help] [options] ...
$ ansible-galaxy search win_vim
Found 11 roles matching your search:
Name Description
---- -----------
chusiang.win_vim Install Vim and on Windows.
mingraham.win_import_pfx_cert Imports pfx certs to windows machine with pr
alban.andrieu.windows A role for installing windows
ypid.wine Setup and manage Wine for running MS Windows
trondhindenes.win_reboot A role to manage reboots on Windows nodes. T
kafecho.windows-couchdb Ansible role to deploy Apache CouchDB 1.6.1
cchurch.win-ec2 Create and destroy Windows instances on EC2.
shrikeh.pagerduty-maintenance-windows Ansible role to create PagerDuty scheduled m
peterszatmary.xfce Installs the XFCE window manager and lightdm
JamesSmaldon.xfce Installs the XFCE window manager and lightdm
deekayen.tls Host more secure communications for services
(END)
25. 怎麼安裝 Roles?
25
$ ansible-galaxy install chusiang.win_vim
- downloading role 'win_vim', owned by chusiang
- downloading role from https://github.com/chusiang/win_vim.ansible.role/
archive/1.0.5.tar.gz
- extracting chusiang.win_vim to /usr/local/etc/ansible/roles/chusiang.win_vim
- chusiang.win_vim was installed successfully
$ ansible-galaxy install -f -p roles chusiang.win_vim
- downloading role 'win_vim', owned by chusiang
- downloading role from https://github.com/chusiang/win_vim.ansible.role/
archive/1.0.5.tar.gz
- extracting chusiang.win_vim to roles/chusiang.win_vim
- chusiang.win_vim was installed successfully
怎麼邊安裝 Roles 邊⾃自訂 Roles 位置?
58. inventory 是什什麼?
• 在控管 Windows Managed node 前,我們還需設定這些
inventory 變數。
58
$ vim group_vars/windows.yml
---
# windows support
#################
ansible_connection: winrm
ansible_port: 5986
# The following is necessary for Python 2.7.9+ when using
# default WinRM self-signed certificates:
ansible_winrm_server_cert_validation: ignore
74. 常⽤用的 Windows Module 有哪些?
1. raw: Executes a low-down and dirty SSH command.
2. win_copy: Copies files to remote locations on windows
hosts.
3. win_file: Creates, touches or removes files or directories.
4. win_get_url: Fetches a file from a given URL.
5. win_lineinfile: Ensure a particular line is in a file, or
replace an existing line using a back-referenced regular
expression.
75. 常⽤用的 Windows Module 有哪些?
6. win_msi: Installs and uninstalls Windows MSI files.
7. win_ping: A windows version of the classic ping
module.
8. win_reboot: Reboot a windows machine.
9. win_stat: returns information about a Windows file.
10.win_template: Templates a file out to a remote server.
77. 參參考⽂文獻
A. 《Ansible: Up and Running》- https://www.ansible.com/ansible-book
B. Windows Support | Ansible Docs - http://docs.ansible.com/ansible/intro_windows.html
C. Ansible 2.0 and Windows | AnsibleFest London 2016 - https://goo.gl/OmScaQ
D. Ansible 實戰講堂 - http://get.soft-arch.net/ansible/
E. 淺談 Ansible by sakana / Max - https://goo.gl/gR0dox
F. 現代 IT ⼈人⼀一定要知道的 Ansible ⾃自動化組態技巧 | 凍仁的筆記 - http://goo.gl/JXqlez
G. 開始⽤用 Ansible 管理理 Windows | @metavige - https://goo.gl/F79v1N
H. Create A Vagrant Windows Base Box | Smalltown Tech Blog - https://goo.gl/rcy3tT
I. Issues · ansible/ansible | GitHub - https://github.com/ansible/ansible/issues
77
Free
78. 圖片來來源
a. Blasts Off Space Rocket From Cosmodrom In The Clouds, Polygonal Stock
Illustration | dreamstime - http://goo.gl/6FAuiQ
b. 國家地理理雜誌 - http://www.ngtaiwan.com
c. Avatar, business, company, group, manager, people, users icon | Icon search engine
- https://goo.gl/Hm6ScX
d. A Galaxy Just Appeared Out of Nowhere - http://goo.gl/ND2Jwb
e. PowerShell Gallery | azure-sdk - https://goo.gl/bES4Ba
f. Brown Book Icon - someBooks Icons - SoftIcons.com - http://goo.gl/IDb4jp
g. Deployment of Symfony2 applications with Ansible - ServerGroveServerGrove
- http://blog.servergrove.com/2014/04/01/deployment-symfony2-applications-ansible/
78