development with ansible & vms

59
Development with Ansible & VMs

Upload: jeff-schenck

Post on 03-Dec-2014

313 views

Category:

Engineering


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Development with Ansible & VMs

Development with Ansible & VMs

Page 2: Development with Ansible & VMs

Development with Ansible & VMs

OUTLINE

1. BETTER DEV 2. ENVIRONMENT TOOLS

3. CONFIG TOOLS 4. WRAP-UP

Page 3: Development with Ansible & VMs

Development with Ansible & VMs

1. BETTER DEV2. ENVIRONMENT TOOLS

3. CONFIG TOOLS 4. WRAP-UP

Page 4: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

Page 5: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

Page 6: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

Page 7: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

Page 8: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

• Your tools

Page 9: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

• Your tools

• Shareable

Page 10: Development with Ansible & VMs

Development with Ansible & VMs

2. ENVIRONMENT TOOLS1. BETTER DEV

3. CONFIG TOOLS 4. WRAP-UP

Page 11: Development with Ansible & VMs

Development with Ansible & VMs

PIP

• Installs Python packages

Page 12: Development with Ansible & VMs

Development with Ansible & VMs

PIP

• Installs Python packages

• Keep using it!

Page 13: Development with Ansible & VMs

Development with Ansible & VMs

VIRTUALENV

• Isolates Python packages

Page 14: Development with Ansible & VMs

Development with Ansible & VMs

VIRTUALENV

• Isolates Python packages

• Doesn’t go far enough…

Page 15: Development with Ansible & VMs

Development with Ansible & VMs

VM

• Isolates entire box

Page 16: Development with Ansible & VMs

Development with Ansible & VMs

VM

• Isolates entire box

• Python packages

Page 17: Development with Ansible & VMs

Development with Ansible & VMs

VM

• Isolates entire box

• Python packages

• System packages

Page 18: Development with Ansible & VMs

Development with Ansible & VMs

VM

• Isolates entire box

• Python packages

• System packages

• Production-like

Page 19: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Page 20: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

$ vagrant init hashicorp/precise64!$ vagrant up!$ vagrant ssh

Page 21: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Vagrant::configure("2") do |config|! config.vm.box = "hashicorp/precise64"! config.vm.hostname = "chewse"! config.vm.network "private_network", ip: "10.0.0.100"!!

config.vm.provision "ansible" do |ansible|! ansible.playbook = "ansible/chewse.yml"! end!end!

Page 22: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Vagrant::configure("2") do |config|! config.vm.box = "hashicorp/precise64"! config.vm.hostname = "chewse"! config.vm.network "private_network", ip: "10.0.0.100"!!

config.vm.provision "ansible" do |ansible|! ansible.playbook = "ansible/chewse.yml"! end!end!

Page 23: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Vagrant::configure("2") do |config|! config.vm.box = "hashicorp/precise64"! config.vm.hostname = "chewse"! config.vm.network "private_network", ip: "10.0.0.100"!!

config.vm.provision "ansible" do |ansible|! ansible.playbook = "ansible/chewse.yml"! end!end!

Page 24: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Vagrant::configure("2") do |config|! config.vm.box = "hashicorp/precise64"! config.vm.hostname = "chewse"! config.vm.network "private_network", ip: "10.0.0.100"!!

config.vm.provision "ansible" do |ansible|! ansible.playbook = "ansible/chewse.yml"! end!end!

Page 25: Development with Ansible & VMs

Development with Ansible & VMs

VM SETUP

Vagrant::configure("2") do |config|! config.vm.box = "hashicorp/precise64"! config.vm.hostname = "chewse"! config.vm.network "private_network", ip: "10.0.0.100"!!

config.vm.provision "ansible" do |ansible|! ansible.playbook = "ansible/chewse.yml"! end!end!

Page 26: Development with Ansible & VMs

Development with Ansible & VMs

3. CONFIG TOOLS

1. BETTER DEV 2. ENVIRONMENT TOOLS

4. WRAP-UP

Page 27: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION

• Defines system setup

Page 28: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION

• Defines system setup

• Written in code

Page 29: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION

• Defines system setup

• Written in code

• Documented and versioned

Page 30: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION

• Defines system setup

• Written in code

• Documented and versioned

• Shareable

Page 31: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

bash

Page 32: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

bash

Page 33: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes!!- name: bootstrap pip and virtualenv! pip: name={{ item.name }} version={{ item.version }}! with_items:! - { name: pip, version: 1.4.1 }! - { name: virtualenv, version: 1.10.1 }! sudo: yes!!- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt virtualenv=/var/venv! sudo: yes!!- name: source virtualenv in .bashrc! lineinfile: dest=/home/vagrant/.bashrc line="{{ item }}"! with_items:! - source /var/venv/bin/activate! - cd /vagrant/chewse!

Page 34: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: standard python system packages! ...!!

- name: bootstrap pip and virtualenv! ...!!

- name: install requirements.txt! ...!!

- name: source virtualenv in .bashrc! ...

Page 35: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes

Page 36: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes

Page 37: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes

Page 38: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes

Page 39: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: bootstrap pip and virtualenv! pip: name={{ item.name }} version={{ item.version }}! with_items:! - { name: pip, version: 1.4.1 }! - { name: virtualenv, version: 1.10.1 }! sudo: yes!

Page 40: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: bootstrap pip and virtualenv! pip: name={{ item.name }} version={{ item.version }}! with_items:! - { name: pip, version: 1.4.1 }! - { name: virtualenv, version: 1.10.1 }! sudo: yes!

Page 41: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: bootstrap pip and virtualenv! pip: name={{ item.name }} version={{ item.version }}! with_items:! - { name: pip, version: 1.4.1 }! - { name: virtualenv, version: 1.10.1 }! sudo: yes!

Page 42: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt ! virtualenv=/var/venv! sudo: yes!

Page 43: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt ! virtualenv=/var/venv! sudo: yes!

Page 44: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: source virtualenv in .bashrc! lineinfile: dest=/home/vagrant/.bashrc line="{{ item }}"! with_items:! - source /var/venv/bin/activate! - cd /vagrant/chewse!

Page 45: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: source virtualenv in .bashrc! lineinfile: dest=/home/vagrant/.bashrc line="{{ item }}"! with_items:! - source /var/venv/bin/activate! - cd /vagrant/chewse!

Page 46: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP

- name: source virtualenv in .bashrc! lineinfile: dest=/home/vagrant/.bashrc line="{{ item }}"! with_items:! - source /var/venv/bin/activate! - cd /vagrant/chewse!

Page 47: Development with Ansible & VMs

Development with Ansible & VMs

CONFIGURATION SETUP- name: standard python system packages! apt: pkg={{ item }} state=installed! with_items:! - python! - python-dev! - python-pip! - libxml2-dev! - libxslt1-dev! sudo: yes!!- name: bootstrap pip and virtualenv! pip: name={{ item.name }} version={{ item.version }}! with_items:! - { name: pip, version: 1.4.1 }! - { name: virtualenv, version: 1.10.1 }! sudo: yes!!- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt virtualenv=/var/venv! sudo: yes!!- name: source virtualenv in .bashrc! lineinfile: dest=/home/vagrant/.bashrc line="{{ item }}"! with_items:! - source /var/venv/bin/activate! - cd /vagrant/chewse!

Page 48: Development with Ansible & VMs

Development with Ansible & VMs

4. WRAP-UP

1. BETTER DEV 2. ENVIRONMENT TOOLS

3. CONFIG TOOLS

Page 49: Development with Ansible & VMs

Development with Ansible & VMs

OUR INSTALL

• Install VirtualBox and Vagrant

Page 50: Development with Ansible & VMs

Development with Ansible & VMs

OUR INSTALL

• Install VirtualBox and Vagrant

• Git clone chewse

Page 51: Development with Ansible & VMs

Development with Ansible & VMs

OUR INSTALL

• Install VirtualBox and Vagrant

• Git clone chewse

• Vagrant up

Page 52: Development with Ansible & VMs

Development with Ansible & VMs

OUR INSTALL

• Install VirtualBox and Vagrant

• Git clone chewse

• Vagrant up

• Dev nirvana

Page 53: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

Page 54: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

Page 55: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

Page 56: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

Page 57: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

• Your tools

Page 58: Development with Ansible & VMs

Development with Ansible & VMs

DEV WISH LIST

• Standardized

• Repeatable

• Isolated

• Production-like

• Your tools

• Shareable

Page 59: Development with Ansible & VMs

Development with Ansible & VMs

Jeff Schenck CTO & Co-Founder twitter: @jeffschenck !

www.chewse.com