Changeset View
Changeset View
Standalone View
Standalone View
README.md
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
See the dedicated readme[1] in the packer directory for more information to manage this image. | See the dedicated readme[1] in the packer directory for more information to manage this image. | ||||
### Setup | ### Setup | ||||
Vagrant tools must be installed. | Vagrant tools must be installed. | ||||
``` | ``` | ||||
apt install vagrant nfs-kernel-server | apt install nfs-kernel-server libvirt-daemon-system qemu-kvm vagrant vagrant-libvirt | ||||
``` | ``` | ||||
Note: `nfs-kernel-server` is needed to export and share the local /tmp/puppet | Note: `nfs-kernel-server` is needed to export and share the local /tmp/puppet | ||||
to the vm | to the vm | ||||
Multiple provisioners exist. We will focus on 2 for now, virtualbox the default | Multiple provisioners exist. We will focus on the one packaged within debian, | ||||
and libvirt for now (we had an history of using this one in the past). | libvirt for now (we had an history of using this one in the past). | ||||
#### virtualbox | Note that you need to add your user to the `libvirt` group: | ||||
On a debian based environment, | |||||
[a specific debian repository must be configured](https://www.virtualbox.org/wiki/Linux_Downloads): | |||||
``` | |||||
apt install virtualbox-6.0 linux-headers-$(uname --kernel-release) | |||||
``` | |||||
Note: | |||||
- 2020-09-17 vagrant (buster) is not working with virtualbox 6.1, so we use | |||||
`virtualbox-6.0` | |||||
- `linux-headers` package is required for the vbox guest additions | |||||
#### libvirt | |||||
Already part of debian so: | |||||
``` | |||||
apt install libvirt-daemon-system qemu-kvm vagrant=2.2.3+dfsg-1 vagrant-libvirt | |||||
``` | |||||
Note: | |||||
- Use the vagrant packaged packaged in debian stable (not hashicorp's) | |||||
- Add your user to the libvirt group. | |||||
``` | ``` | ||||
sudo usermod --append --groups libvirt `whoami` | sudo usermod --append --groups libvirt `whoami` | ||||
``` | ``` | ||||
``` | |||||
usermod -a -G libvirt $USER | |||||
``` | |||||
### Usage | ### Usage | ||||
#### Prepare the puppet environment | #### Prepare the puppet environment | ||||
The puppet directory structure needs to be prepared before starting a vm. | The puppet directory structure needs to be prepared before starting a vm. | ||||
It can be done with the ``bin/prepare-vagrant-conf`` script. The script must be run each time a new commit is done to refresh the code applied on the vms. | It can be done with the ``bin/prepare-vagrant-conf`` script. The script must be run each time a new commit is done to refresh the code applied on the vms. | ||||
The working directory is ``/tmp/puppet``. | The working directory is ``/tmp/puppet``. | ||||
Show All 23 Lines | |||||
vagrant status | vagrant status | ||||
``` | ``` | ||||
Example: | Example: | ||||
``` | ``` | ||||
$ vagrant status | $ vagrant status | ||||
Current machine states: | Current machine states: | ||||
staging-webapp running (virtualbox) | staging-webapp running (libvirt) | ||||
staging-worker0 running (virtualbox) | staging-worker0 running (libvirt) | ||||
staging-deposit not created (libvirt) | staging-deposit not created (libvirt) | ||||
prod-worker01 not created (virtualbox) | prod-worker01 not created (libvirt) | ||||
test poweroff (virtualbox) | test poweroff (libvirt) | ||||
This environment represents multiple VMs. The VMs are all listed | This environment represents multiple VMs. The VMs are all listed | ||||
above with their current state. For more information about a specific | above with their current state. For more information about a specific | ||||
VM, run `vagrant status NAME`. | VM, run `vagrant status NAME`. | ||||
``` | ``` | ||||
#### Start a vm | #### Start a vm | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |