More Related Content
Similar to Development with Ansible & VMs (20)
Development with Ansible & VMs
- 9. Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
• Shareable
- 21. 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!
- 22. 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!
- 23. 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!
- 24. 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!
- 25. 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!
- 30. Development with Ansible & VMs
CONFIGURATION
• Defines system setup
• Written in code
• Documented and versioned
• Shareable
- 33. 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!
- 34. 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!
...
- 35. 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
- 36. 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
- 37. 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
- 38. 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
- 39. 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!
- 40. 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!
- 41. 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!
- 42. Development with Ansible & VMs
CONFIGURATION SETUP
- name: install requirements.txt!
pip: requirements=/vagrant/requirements.txt !
virtualenv=/var/venv!
sudo: yes!
- 43. Development with Ansible & VMs
CONFIGURATION SETUP
- name: install requirements.txt!
pip: requirements=/vagrant/requirements.txt !
virtualenv=/var/venv!
sudo: yes!
- 44. 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!
- 45. 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!
- 46. 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!
- 47. 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!
- 52. Development with Ansible & VMs
OUR INSTALL
• Install VirtualBox and Vagrant
• Git clone chewse
• Vagrant up
• Dev nirvana
- 58. Development with Ansible & VMs
DEV WISH LIST
• Standardized
• Repeatable
• Isolated
• Production-like
• Your tools
• Shareable