A demo of Razor using Vagrant.
This is a demo using Vagrant of Puppet Lab's Razor introduction.
First install VirtualBox and the VirtualBox Extension Pack. Next bundle & boot the servers:
$ bundle install
$ bundle exec rake start
The gold
server will boot first and kick off a puppet run. This will
install razor and setup dhcp on the internal VM network. Once the gold
server finished the agent1
box will boot. agent1
initially fails to
PXE boot because razor is not configured with a microkernel.
$ bundle exec rake microkernel
The microkernel
rake task downloads and registers the razor microkernel.
At this point agent1
will boot the microkernel.
The agent1
server will register itself with razor. We can inspect it
via the razor node
command.
$ bundle exec vagrant ssh gold
$ sudo su -
$ cd /opt/razor
$ bin/razor node
The razor node attributes
command will show the attributes of agent1
.
$ bin/razor node -UUID- -f attributes
Run the ubuntu
rake task to download and register Ubuntu Precise 12.04
Server with razor. This may take a while.
$ bundle exec rake ubuntu
List the registered OS images via razor image
.
$ bundle exec vagrant ssh gold
$ sudo su -
$ cd /opt/razor
$ bin/razor image
Add a model for ubuntu\_precise
with the new image.
$ bin/razor model add --template=ubuntu_precise --label=install_precise --image-uuid=...
Create a policy to install ubuntu on agent1
.
$ bin/razor policy add --template=linux_deploy --label=precise --broker-uuid=none --tags=virtualbox_vm --enabled true --model-uuid=...
On the next checkin by agent1
the server will reboot. Instead of booting
the microkernel, razor serves agent1
the Ubuntu installer.
Once that finishes you can login as root with your password.
Run vagrant destroy
to cleanup everything.
$ bundle exec vagrant destroy --force