Migrating from another
configuration
management system
Robby Colvin
@geetarista
Slide 2
Slide 2 text
$ whoami
Slide 3
Slide 3 text
About Me
• Work @ Kiip
• Software Engineer
• Operations Engineer
• Engineer
Slide 4
Slide 4 text
$ cat /etc/passwd | grep audience
Slide 5
Slide 5 text
Why choose
Ansible?
Slide 6
Slide 6 text
Why choose Ansible?
• Application Deployment
• Cloud-aware orchestration
• Ad-hoc tasks
• Low barrier to entry stack-wise
• Simple for developers to grasp
• Python + Boto
• No central server required
• Flexibility
Slide 7
Slide 7 text
Is it right for you?
Slide 8
Slide 8 text
Is it right for you?
• Is it cost-effective?
• Does it fit your culture?
• Does it align with your goals?
• Can you abandon your current tooling?
• Does it improve productivity?
Migration Plan
1. Get your feet wet
2. Plan/organize
3. Execute
Slide 14
Slide 14 text
Get Your Feet Wet
Slide 15
Slide 15 text
Get Your Feet Wet
• Several options to start with Ansible
Slide 16
Slide 16 text
Get Your Feet Wet
• Several options to start with Ansible
• Risk free™
Slide 17
Slide 17 text
Get Your Feet Wet
• Several options to start with Ansible
• Risk free™
• Pick a simple role
Slide 18
Slide 18 text
Get Your Feet Wet
• Several options to start with Ansible
• Risk free™
• Pick a simple role
• Take baby steps
Slide 19
Slide 19 text
Get Your Feet Wet
• Several options to start with Ansible
• Risk free™
• Pick a simple role
• Take baby steps
• Simple Module(s)
Slide 20
Slide 20 text
Get Your Feet Wet
• Several options to start with Ansible
• Risk free™
• Pick a simple role
• Take baby steps
• Simple Module(s)
• Build on what you learn
Existing Boxes
• CLI
• --check --diff
• Push from your machine
• Run simple modules: ping, setup, etc.
• Move on to other modules
Slide 25
Slide 25 text
Vagrant
Slide 26
Slide 26 text
Vagrant
• Run from your machine to Vagrant host
• Use Ansible provisioner
• Go crazy
• Simulate multiple hosts, clusters, etc.
Slide 27
Slide 27 text
Vagrant Ansible provisioner
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant.yml"
end
end
Slide 28
Slide 28 text
Ansible Vagrant host
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.network :private_network,
ip: "192.168.33.10"
end
Take stock
• Identify existing cruft
• Get to know Ansible modules
(don't re-invent the wheel)
• Identify custom modules to be written
• Integrate with infrastructure
• Get to know the documentation
• Learn how to use the CLI
• Learn how to write Jinja2 templates
Slide 33
Slide 33 text
Organize
• Host inventory
Slide 34
Slide 34 text
Host Inventory
• Write inventory by hand
• Use ec2.py
• Write your own inventory script
Playbooks
• Top-level
• Include other playbooks
• Node definitions
Slide 40
Slide 40 text
Playbooks
---
- hosts: web
roles:
- common
- nginx
- postgresql
Slide 41
Slide 41 text
Organize
• Host inventory
• Roles
• Playbooks
• Choose a mode
Slide 42
Slide 42 text
Choose a Mode
• Push
• Pull
• Manager (API)
Slide 43
Slide 43 text
Start the rewrite
Slide 44
Slide 44 text
Start the rewrite
• Baby steps: one role at a time
Slide 45
Slide 45 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
Slide 46
Slide 46 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
• Test against staging or box outside LB
Slide 47
Slide 47 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
• Test against staging or box outside LB
• Vagrant
Slide 48
Slide 48 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
• Test against staging or box outside LB
• Vagrant
• Write new roles/playbooks in ansible
Slide 49
Slide 49 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
• Test against staging or box outside LB
• Vagrant
• Write new roles/playbooks in ansible
• Get everyone involved
Slide 50
Slide 50 text
Start the rewrite
• Baby steps: one role at a time
• Use --check --diff
• Test against staging or box outside LB
• Vagrant
• Write new roles/playbooks in ansible
• Get everyone involved
• Stay up to date with documentation
Slide 51
Slide 51 text
Last Steps
Slide 52
Slide 52 text
NONE!
• If done properly, you should be good to go
• Just iterate and continue forward
• Move on to advanced topics