Leverage Packer, Vagrant, and Ansible as part of a service delivery pipeline. Streamline your continuous delivery process while also targeting multiple cloud providers.
3. Linux, IaaS, AWS,
Rackspace, VMWare,
oVirt, Spacewalk,
Cobbler, Puppet, Ansible,
Chef, Kickstart, Seed
Linux Administrators
SAN Engineers
Network Engineers
DevOps
ITOps
Service Level Agreements
Budgets
Staffing Guidance
Procurement Process
Authority to Operate
Auditing & Compliance
Infrastructure
My new app is
going to be the
next big thing!
28. Automation
No human interaction. Great for
Continuous Integration / Deployment
Standardization
Use Puppet, Chef, Ansible, Bash to
configure the image
Repeatability
Template goes into version control
Image creation knowledge is now in code
Anyone can build / rebuild the base images
32. $ packer validate base-image.json
Template validated successfully.
$ packer build base-image.json
amazon-ebs output will be in this color.
digitalocean output will be in this color.
…
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' finished.
==> digitalocean: Destroying droplet...
==> digitalocean: Deleting temporary ssh key...
Build 'digitalocean' finished.
==> Builds finished. The artifacts of successful builds are:
--> digitalocean: A snapshot was created: 'centos-baseline
1396457723' in region 'New York 1'
36. Deploy to Multiple
Providers
AWS, DigitalOcean, HP Cloud,
Joyent, KVM, libvirt, lxc,
OpenStack, Rackspace, Vmware,
VirtualBox
vagrant up --provider=foo
37. • Simplifies the provisioning
process for servers.
• Easier to have an instance per
systems component.
• Copy files to new images. (i.e.
Keys, Scripts, RPMs)
Workflow
39. Leverage Your own
Packer Images
• Base Image as starting point.
• Integrates with multiple
“provisioners” – Puppet, Chef,
Ansible, Bash
40. Automation
No human interaction. Great for
Continuous Delivery
Standardization
Can also use Puppet, Chef, Ansible, Bash
Use Packer images as base images
Repeatability
Template goes into version control
Image creation knowledge is now in code
Anyone can build / rebuild the environment
42. Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.box_url = "https://github.com/mitchellh/
vagrant-aws/raw/master/dummy.box"
config.vm.provider :aws do |aws, override|
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME”
aws.ami = ”ami-9baa9cf2”
override.ssh.username = "ec2-user"
override.ssh.forward_agent = true
override.ssh.private_key_path = "PATH TO YOUR
PRIVATE KEY"
end
end
Vagrantfile
43. $ vagrant up --provider=aws
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider…
Running Vagrant
46. • Configuration Management tool
like Puppet, Chef, CFEngine
• Quick to get started
• Builds on familiar tools
• Run commands over SSH. No
additional agents required
48. …
config.vm.provision :ansible do |ansible|
ansible.sudo = true
ansible.playbook = "provisioning/ansible/playbook.yml”
ansible.verbose = true
end
- hosts: all
tasks:
- name: ensure ntpd is at the latest version
yum: pkg=ntp state=latest
notify:
- restart ntpd
handlers:
- name: restart ntpd
service: name=ntpd state=restarted
49. $ vagrant provision
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider...
WARNING: Nokogiri was built against LibXML version 2.8.0, but
has dynamically loaded 2.9.1
Installing a LAMP Stack on CentOS
51. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
boxes.each do |box|
config.vm.define box[:name], primary: box[:primary] do |config|
config.vm.box = "aws-centos"
config.vm.box_url =
https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
…
config.vm.provision :shell, :privileged => false, :inline => "sudo
yum -y install screen"
config.vm.provision :ansible do |ansible|
ansible.sudo = true
ansible.playbook = "provisioning/ansible/playbook-
lamp.yml"
ansible.verbose = true
end
…
52. - name : Install LAMP Stack
user: ec2-user
hosts: all
tasks:
- name: Install mysql
yum: name=mysql-server state=latest
- name: install httpd
yum: name=httpd
- name: Install php for mysql
yum: name=$item
with_items:
- php
- php-mysql
- mysql-server
53. $ vagrant up --provider=aws
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider...
WARNING: Nokogiri was built against LibXML version 2.8.0, but
has dynamically loaded 2.9.1
$ vagrant provision