development with ansible & vms
DESCRIPTION
TRANSCRIPT
Development with Ansible & VMs
Development with Ansible & VMs
OUTLINE
1. BETTER DEV 2. ENVIRONMENT TOOLS
3. CONFIG TOOLS 4. WRAP-UP
Development with Ansible & VMs
1. BETTER DEV2. ENVIRONMENT TOOLS
3. CONFIG TOOLS 4. WRAP-UP
Development with Ansible & VMs
DEV WISH LIST
• Standardized
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
• Shareable
Development with Ansible & VMs
2. ENVIRONMENT TOOLS1. BETTER DEV
3. CONFIG TOOLS 4. WRAP-UP
Development with Ansible & VMs
PIP
• Installs Python packages
Development with Ansible & VMs
PIP
• Installs Python packages
• Keep using it!
Development with Ansible & VMs
VIRTUALENV
• Isolates Python packages
Development with Ansible & VMs
VIRTUALENV
• Isolates Python packages
• Doesn’t go far enough…
Development with Ansible & VMs
VM
• Isolates entire box
Development with Ansible & VMs
VM
• Isolates entire box
• Python packages
Development with Ansible & VMs
VM
• Isolates entire box
• Python packages
• System packages
Development with Ansible & VMs
VM
• Isolates entire box
• Python packages
• System packages
• Production-like
Development with Ansible & VMs
VM SETUP
Development with Ansible & VMs
VM SETUP
$ vagrant init hashicorp/precise64!$ vagrant up!$ vagrant ssh
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!
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!
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!
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!
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!
Development with Ansible & VMs
3. CONFIG TOOLS
1. BETTER DEV 2. ENVIRONMENT TOOLS
4. WRAP-UP
Development with Ansible & VMs
CONFIGURATION
• Defines system setup
Development with Ansible & VMs
CONFIGURATION
• Defines system setup
• Written in code
Development with Ansible & VMs
CONFIGURATION
• Defines system setup
• Written in code
• Documented and versioned
Development with Ansible & VMs
CONFIGURATION
• Defines system setup
• Written in code
• Documented and versioned
• Shareable
Development with Ansible & VMs
CONFIGURATION SETUP
bash
Development with Ansible & VMs
CONFIGURATION SETUP
bash
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!
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! ...
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
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
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
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
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!
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!
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!
Development with Ansible & VMs
CONFIGURATION SETUP
- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt ! virtualenv=/var/venv! sudo: yes!
Development with Ansible & VMs
CONFIGURATION SETUP
- name: install requirements.txt! pip: requirements=/vagrant/requirements.txt ! virtualenv=/var/venv! sudo: yes!
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!
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!
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!
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!
Development with Ansible & VMs
4. WRAP-UP
1. BETTER DEV 2. ENVIRONMENT TOOLS
3. CONFIG TOOLS
Development with Ansible & VMs
OUR INSTALL
• Install VirtualBox and Vagrant
Development with Ansible & VMs
OUR INSTALL
• Install VirtualBox and Vagrant
• Git clone chewse
Development with Ansible & VMs
OUR INSTALL
• Install VirtualBox and Vagrant
• Git clone chewse
• Vagrant up
Development with Ansible & VMs
OUR INSTALL
• Install VirtualBox and Vagrant
• Git clone chewse
• Vagrant up
• Dev nirvana
Development with Ansible & VMs
DEV WISH LIST
• Standardized
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
• Shareable
Development with Ansible & VMs
Jeff Schenck CTO & Co-Founder twitter: @jeffschenck !
www.chewse.com