2. www.rackspace.com 2
About Me
- Sri
Rajan
- From
India
- 9
years
in
Texas,
4+
in
UK
- 10+
years
in
IT,
6+
years
at
Rackspace
- SpecialAes:
Linux,
OpenStack,
AutomaAon
linkedin.com/in/rajansriram
+SriramRajan
@sriramrajan
3. 9 Worldwide
Data Centers
We Serve FORTUNE®
5,000+ Rackers
Global Footprint
Customers in
120+ Countries
Over $1B Annualized Revenue
www.rackspace.com 3
About Rackspace
60% OF THE
100
OVER
200,000+
90,000+ Servers
26,000+ VM
≅70 PB Stored
Customers
Portfolio of
Hosted Solutions
Dedicated - Cloud - Hybrid
5. Fictional
machine
capable
of
instantaneous
or
superluminal
communication
Image Credits :
http://popten.net/2009/02/etymology-101-ansible-a-hypothetical-machine-capable-of-
superluminal-communication/
17. Inventory
- Host listing/Grouping
- Rackapce/AWS/OpenStack
API
- Your own
- All of the above
Image Credit: http://i.dailymail.co.uk/i/pix/2012/10/17/article-2219188-158CE597000005DC-42_964x507.jpg
19. Use
Is host alive?
$ ansible -i <inventory file> all -m ping
ss-dfw-00 | success >> {
"changed": false,
"ping": "pong"
}
20. Use
Run arbitrary commands
$ ansible -i <inventory> all -m shell –a ‘df –h’
ss-dfw-00 | success | rc=0 >>
Filesystem Size Used Avail Use%
Mounted on
rootfs 20G 1.6G 18G 9% /
udev 10M 0 10M 0% /
dev
…
21. With great power…
$ ansible -i <inventory> all -m shell –a ‘rm –rf /’
22. Tasks
- A discrete action
- Declaration of system state
- Directory should exist
- Package should be installed
- Service should be running
23. Modules
- Bits of code copied to the target to satisfy
the task declaration
- Code need not exist on remote host
- Can be implemented in any language
24. Modules
Batteries Included !!
• run commands
• transfer files
• install packages
• manage daemons
• manage users and
groups
• gather facts
• deploy software with
SCM
• manage DBs (MySQL,
PostgreSQL, MongoDB,
Redis, …)
http://docs.ansible.com/modules_by_category.html
25. Tasks & Modules
$ ansible web –m service –a “name=nginx
enabled=yes state=started”
26. Modules
$ ansible-doc -l
acl Sets and retrieves file ACL information.
airbrake_deployment Notify airbrake about app deployments
apache2_module enables/disables a module of the Apache2
webserver
apt Manages apt-packages
27. Plays & Playbooks
- Plays are ordered set of tasks
- Playbooks contain one or more plays
- Written in Yaml
- Declarative
- Execute in the order it is written
28. Playbooks
-‐-‐-‐
-‐
name:
Install
UI
for
Demo
hosts:
Define
hosts
Or
Groups
-‐
demoservers
vars:
-‐
DEMO_ROOT:
/demos
-‐
UI_SCRIPT_ROOT:
"{{DEMO_ROOT}}/scripts"
Define
variables
37. Windows
- Fairly new (announced this year)
- Works with winrm
- Runs from a Linux control station (python
winrm module)
39. Tower
- Extra bells and whistles
- Role based access
- Push button jobs
- Dashboard
- Auditing
- Talks to the enterprise
- Makes them pay for it J
40. Ansible in Rackspace
- Disclaimer
- Manage public cloud
- Developer support
- Automate system admin tasks (Ransack)