simulierte Produktivumgebung
* ok, ok, Firewalls existieren…
% vagrant init \
wheezy64 http://goo.gl/6NaeqW
% ls
Vagrantfile
% egrep -v "^\s*(#|$)" Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "wheezy64"
config.vm.box_url = "http://goo.gl/6NaeqW"
end
% vagrant up
% vagrant ssh
vagrant@wheezy64:~$ uptime
09:05:02 up 6 min, 1 user, load average: 0.00, 0.01, 0.01
vagrant@wheezy64:~$ cat /etc/debian_version
7.1
sudo aptitude install apache2 lynx -y
# …
lynx -dump http://localhost
% vim Vagrantfile -c "/forwarded_port"
config.vm.network :forwarded_port, guest: 80, host: 8080
% vagrant reload
Öffne http://localhost:8080
% touch "Hello World"
% vagrant ssh
vagrant@wheezy64:~$ ls /vagrant/
Hello World Vagrantfile
Vagrant stellt den Ordner mit Vagrantfile im Host unter /vagrant im Gast bereit.
% vagrant destroy -f
vim Vagrantfile -c ":57"
config.vm.provision :shell, :path => "setup.sh"
#!/bin/sh
aptitude install apache2 -y
aptitude install phpmyadmin -y
aptitude install mysql -y
# apache2 konfigurieren
# PHP-Xdebug konfigurieren?
* es gibt noch andere, z.B. Chef
package { 'apache2':
ensure => installed
}
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
end
puppet module install puppetlabs-apache
Tipp: diese Zeile in die setup.sh: Shellscript bootstrapt Puppet
# "class { 'apache': }" beinhaltet bereits:
# package { 'apache2':
# ensure => installed,
# }
class { 'apache':
default_vhost => false,
}
apache::vhost { 'localhost':
docroot => '/vagrant',
port => '80',
}
% vagrant up
veewee vbox define wheezy64 'Debian-7.2.0-amd64-netboot'
vim definitions/wheezy64/
veewee vbox build wheezy64
veewee vbox export wheezy64