4. Ansible: good points
Minimal managed node requirements
Simple tool chain and files
YAML
and many built-in modules
Less stress of shell scripts
Dynamic inventory
14年6月10日火曜日
5. Ansible: bad points
Less japanese case-studies
Less japanese books and blog entries
Less japanese users? -> No!
14年6月10日火曜日
8. ROLEs and TYPEs
Roles (web, app, db, hadoop, ...)
Groups (service-names, ...)
OSs, Server models, Disk types (HDD, SSD, ioDrive, ...)
IP addrs (local, global, virtual)
... and many more
14年6月10日火曜日
9. Yabitz
Our host management tool/server:
WebUI and WebAPI (json)
hostname[s], status, service, CPU, memory, disk,
rack position, size, local/global/virtual IPs, virtual/
parent server, ....
tags
changes(history, diff)
anything
links to other internal web tools
14年6月10日火曜日
10. Dynamic inventory
Dynamic inventory plugins
Cobbler external inventory script
Example for linux install server
AWS EC2 external inventory script
Digital Ocean, Google Compute Engine, Linode,
Zabbix, ...
Mix inventories (static and dynamic)
14年6月10日火曜日
11. Custom dynamic inventory
Original scripts AS dynamic inventory
“Developing Dynamic Inventory Sources”
http://docs.ansible.com/developing_inventory.html
executable program
implement `--list`
implement `--host HOSTNAME`
14年6月10日火曜日
20. No more host lists!
Ansible inventory is very simple and understandable
But we cannot use it for real world operations
especially for hundreds or thousands of hosts...
Use dynamic inventory!
14年6月10日火曜日
21. Role based playbook testing
Serverspec
testing without breaking operations
providing double check (beside of ansible)
14年6月10日火曜日
22. Serverspec directories
from http://serverspec.org/tutorial.html
host based spec directory tree
spec/
SERVERNAME/
function_spec.rb
and exec (`rake spec`)
“How to share serverspec tests among hosts”
http://serverspec.org/advanced_tips.html
static file based test sharing
14年6月10日火曜日
23. Specs and roles
Role based provisioning
roles-to-hosts resolution MUST be done dynamically
Helper command to get roles from playbooks
and role based spec directory
bin/kick-spec
spec/ROLE/*_spec.rb
14年6月10日火曜日
27. Appendix: “_meta”(1)
Special attribute of JSON for `--list`
To include host variables in single JSON result
No more exec: `--host HOST`
{
“shibuya”: [ “host6.local” ],
“ebisu”: [ “host7.local” ],
“_meta”: {
“hostvars”: {
“host6.local”: { “var1”: “value1”, “var2”: “value2” },
“host7.local”: { .... }
}
}
}
14年6月10日火曜日
28. Without `_meta`:
`--list` x1 and `--host` x1000 !
With `_meta`:
`--list` x1 only!
Appendix: “_meta”(2)
14年6月10日火曜日
29. Benchmark: time before task starts
w/ yabitz_inventory
for thousands of hosts
Appendix: “_meta”(3)
w/o _meta w/ _meta
Elapsed time 18min! 10sec!!!!
14年6月10日火曜日