SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer...
Transcript of SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer...
![Page 1: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/1.jpg)
SALT Vagrant and Virtualbox
Ben Hosmer@bhosmer
Tuesday, October 23, 12
Mention RB government intelligence customersVagrant stores lightweight “boxes” for development and testing.Configuration management can be used to have repeatable environments that you can quickly and easily reset
![Page 2: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/2.jpg)
Local Dev Prod
Tuesday, October 23, 12
Why use configuration management?
![Page 3: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/3.jpg)
Local Dev Prod
Tuesday, October 23, 12
Isn’t this nicer?
![Page 4: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/4.jpg)
Tuesday, October 23, 12
Puppet is a very popular one.It requires ruby etc.
![Page 5: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/5.jpg)
Tuesday, October 23, 12
A sample puppet manifest.You have to kind of know ruby code to make it work or modify it.
![Page 6: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/6.jpg)
Tuesday, October 23, 12
Saltstack is like puppet, but much easier, lighter-weight and uses python and yaml.
![Page 7: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/7.jpg)
Tuesday, October 23, 12
YAML is much easier to read and interpret. You don’t have to know code to modify it.
![Page 8: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/8.jpg)
The Team
Tuesday, October 23, 12
We can combine virtualbox, vagrant, and saltstack for configurations that are transportable and distributable among developers. Consistency!
![Page 9: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/9.jpg)
Remote Execution
Tuesday, October 23, 12
An added benefit that you get out of the box with SALT is remote execution.Type command once and run it on every machine.
![Page 10: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/10.jpg)
What you need.
Tuesday, October 23, 12
![Page 11: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/11.jpg)
Rubyruby-lang.org
Tuesday, October 23, 12
We can’t get away from this, but you don’t need to actually know any ruby code.
![Page 12: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/12.jpg)
Virtualbox.org
Tuesday, October 23, 12
Allows you to run another operating system inside your operating system.Host > Guest paradigm
![Page 13: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/13.jpg)
vagrantup.com
Tuesday, October 23, 12
Vagrant connects our configuration management system and our boxes to an interface that we can script. You can use it without any configuration management. It lets us create a server, destroy it, and then repeat the process easily.
![Page 14: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/14.jpg)
salty-vagrantvagrant gem install vagrant-salt
http://bit.ly/REYBZz
Tuesday, October 23, 12
A ruby gem that connects salt configuration management with vagrant.
![Page 15: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/15.jpg)
A Base Box
vagrantbox.es
Tuesday, October 23, 12
The easiest way to get started is to download a box that has already been created.Get the Ubuntu precise 64 box. There are a lot of others available. CentOS/BSD/Lots of linux flavors.
![Page 16: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/16.jpg)
Tuesday, October 23, 12
Now we’ll start diving deep.
![Page 17: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/17.jpg)
Add your box.
vagrant box add precise64
Tuesday, October 23, 12
Now that you have the box, you need to tell vagrant about it.
![Page 18: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/18.jpg)
Get the Vagrantfile
http://bit.ly/TggfrW
Tuesday, October 23, 12
Vagrant init will create a well-commented file for you, but you don’t need all of the configuration in it. It is much easier to download this from the salty-vagrant github page and copy and paste it.
![Page 19: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/19.jpg)
Add this for web-browser access:
config.vm.network :hostonly, "192.168.33.20"
Tuesday, October 23, 12
![Page 20: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/20.jpg)
Create Your Directories
Tuesday, October 23, 12
![Page 21: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/21.jpg)
minion.conf:
http://bit.ly/RF1x8z
file_client: local
Tuesday, October 23, 12
This is all you need. This tells SALT to get its configuration from a local configuration instead of looking for a remote master.
![Page 22: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/22.jpg)
The Top Filetop.sls
base: '*': - lamp-drupal
Tuesday, October 23, 12
This tells SALT what configuration you want to use.
![Page 23: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/23.jpg)
Lamp-Drupal Salt Statehttp://bit.ly/RF1x8z
Tuesday, October 23, 12
Grab this from the github page.
![Page 24: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/24.jpg)
Vagrant up!
Tuesday, October 23, 12
![Page 25: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/25.jpg)
Vagrant up!
Tuesday, October 23, 12
![Page 26: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/26.jpg)
Tuesday, October 23, 12
![Page 27: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/27.jpg)
Tuesday, October 23, 12
Shared folder:localGuest: /vagrant
![Page 28: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/28.jpg)
Tuesday, October 23, 12
Shared folder:localGuest: /vagrant
![Page 29: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/29.jpg)
Virtualbox Guest Additions must match.
Tuesday, October 23, 12
They probably will not, so you need to update them and then use vagrant box repackage so that your box’s guest additions match the version of virtualbox.
![Page 30: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/30.jpg)
vagrant halt
Tuesday, October 23, 12
Stops the machine, but retains your currently added software and configuration. Basically a shutdown.
![Page 31: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/31.jpg)
salt-call
Tuesday, October 23, 12
Use this for local SALT commands instead of the standard use of “SALT”
![Page 32: SALT Vagrant and Virtualbox - Drupal Groups · SALT Vagrant and Virtualbox Ben Hosmer @bhosmer Tuesday, October 23, 12 Mention RB government intelligence customers Vagrant stores](https://reader031.fdocuments.in/reader031/viewer/2022022703/5bc970de09d3f2ca288d090c/html5/thumbnails/32.jpg)
vagrant destroy(Reset & do-over)
Tuesday, October 23, 12