how vagrantfile stores the changes in vagrant machine? -


i developing application php , client asked me set vagrant machine , install every needed extensions , modules, 1 vagrant command client have same environment have,

i firstly installed vagrant machine 1 of boxes lsit

  vagrant box add ubuntu1 http://goo.gl/kwqsa2 

then run these commands:

      vagrant init ubuntu1       vagrant 

in directory made file there vagranrfile question: need know if make changes server example, installing php or mysql how going saved in setting if give file client able have identical machine mine installed?

i mean there changes vagrantfile or made mistake , had install machine puppet?

thanks in advance

no, vagrant file not going change install things in vm.

if want client have same machine you, you'll have avoid installing softwares through vm's shell. should use provisioner, for everything, mysql tables, apache virtual hosts etc..

and don't use vagrant box add ubuntu1 http://goo.gl/kwqsa2, add box's url vagrantfile with:

config.vm.box_url = "http://goo.gl/kwqsa2" 

example puppet provisioning mysql/php server:

    group { 'puppet':     ensure => 'present', }  # # apache configuration # class { 'apache' :     default_mods => false,     default_confd_files => false,     mpm_module => 'prefork',     default_vhost => false,     sendfile => 'off' } class { 'apache::mod::php' : } # mod_php class { 'apache::mod::rewrite' : } # mod_rewrite  # vhost configuration apache::vhost { 'dev.xxx.fr' :     port => '80',     docroot => '/var/sites/myxxx/web',     access_log => true,     access_log_file => 'xxx_access.log',     error_log => true,     error_log_file => 'xxx_error.log',     aliases => [{alias => '/myxxx', path => '/var/sites/toto/web'}],     directories => [{path => '/var/sites/myxxx/web', 'allow_override' => ['fileinfo', 'indexes']}, {path => '/var/sites/toto/web', 'allow_override' => ['fileinfo', 'indexes']}] }  # # mysql configuration # class { '::mysql::server' :     root_password => 'xxx',     databases => {         'xxx' => {             ensure => 'present',             charset => 'utf8'         }     },     users => {         'xxx@localhost' => {             ensure => 'present',             password_hash => 'xxx' # xxxmdp         }     },     grants => {         'xxx@localhost/xxx' => {             ensure => 'present',             options => ['grant'],             privileges => ['select', 'insert', 'update', 'delete', 'create'],             table      => 'xxx.*',             user       => 'xxx@localhost'         }     } }  class { '::mysql::client' : }  package { 'php5-mysql' :     require => [class['apache::mod::php'], class['::mysql::server']],     ensure => 'present' } 

you need following modules:

  • apache
  • concat
  • mysql
  • stdlib

the puppet config above example, highly encourage read there documentation done: http://docs.puppetlabs.com/learning/introduction.html

honestly, puppet great tool, take time learn it.

one more thing, avoid using shell provisionner, commands executed everytime run "vagrant provision", puppet executes changes. (i use shell provisionner apt-get update , apt-get upgrade)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -