2. About Me
• Automation enthusiast
• Worked in corporate
environments
• Now co-founder of a small startup
company
3. Agenda
• Vagrant intro
• Simple LAMP provisioning setup
• Demo of provisioning on virtual box
• Switching vagrant provider to openstack
4. What is VAGRANT
• https://www.vagrantup.com/
• Manage development environments – up/destroy machines
• Works with different virtualization providers
• “Easy” ruby syntax
• Supports different provisioners
5. Our Simple LAMP
• Linux – Debian box image
• Apache with PHP and memcached
• MySQL / MariaDB
• Deploy application and load database from
a git repo
7. Ansible highlights
• MySql DB – import
• Notify
- name: create wiki app db
mysql_db: name=wikidb state=import
target=/var/www/site/wikidb.sql
handlers:
- name: restart apache
action: service name=apache2 state=restarted
8. Vagrant Ansible provisioner
• Pass variables (facts) to the playbook
• Vagrant specific – like IP
config.vm.provision 'ansible' do |ansible|
ansible.playbook = 'ansible/playbook.yml'
ansible.verbose = 'vvv'
ansible.extra_vars = {
ans_vm_priv_ip: vm_priv_ip
}
end
9. Switch the provider to
OpenStack
vagrant plugin install vagrant-openstack-provider
2. VM is booted
1. Create VM (up)
3. Provision VM over ssh