@@ -15,6 +15,7 @@ Install vagrant:
1515https://www.vagrantup.com/docs/installation/
1616
1717Install guest additions plugin:
18+
1819```
1920$ vagrant plugin install vagrant-vbguest
2021```
@@ -23,9 +24,11 @@ It is also possible to use libvirt (KVM) instead of VirtualBox. Apart from the
2324working ` qemu-kvm ` setup and ` libvirt ` , the ` vagrant-libvirt ` plugin has to be
2425installed too. It may either be provided as a package in your distribution or it
2526can be installed by vagrant itself:
27+
2628```
2729$ vagrant plugin install vagrant-libvirt
2830```
31+
2932Please see the [ libvirt notes] ( #libvirt-notes ) section for some more details and
3033suggestions.
3134
@@ -49,6 +52,7 @@ It is not a strict requirement, it's just easier.
4952If you use another path, you will have to update Vagrantfile and bash scripts.
5053
5154Something like this does the job:
55+
5256```
5357$ sudo mkdir -p /northern.tech/cfengine
5458$ export NTECH_ROOT=/northern.tech
@@ -87,35 +91,43 @@ curl -L -s https://raw.githubusercontent.com/olehermanse/dotfiles/master/install
8791```
8892
8993## Getting started with the dev machine
94+
9095The development machine has all development libraries already installed.
9196It is ready to run autogen, make etc.
9297It will ** NOT** work with ` build-remote ` .
9398(See the sections on the buildslave machine below.)
9499
95100### Creating a base box for development
101+
96102The vagrant VMs use a custom base box where some dependencies are installed.
97103To create this box locally, run:
104+
98105```
99106$ bash ./basebox/create.sh
100107```
108+
101109(vagrant required).
102110This will run commands from ` basebox/bootstrap.sh ` on an Ubuntu VM.
103111If you're not using vagrant, you can run/adapt that script on a build/development machine of your choice.
104112
105113### Starting the development machine
114+
106115```
107116$ vagrant up dev
108117```
109118
110119If you ever need a clean dev machine, log out and:
120+
111121```
112122$ vagrant destroy dev
113123$ vagrant up dev
114124```
125+
115126This is great, because you don't have to be careful not to mess up your dev machine.
116127You can always get a new one within a minute.
117128
118129### Compiling CFEngine Community in the development machine
130+
119131```
120132$ vagrant ssh dev
121133$ cd /northern.tech/cfengine/core
@@ -128,6 +140,7 @@ $ ./autogen.sh --enable-debug
128140### Installing CFEngine Community on a test machine
129141
130142#### Hub
143+
131144```
132145$ vagrant up hub
133146$ vagrant ssh hub
@@ -141,6 +154,7 @@ $ sudo su -
141154```
142155
143156#### Client
157+
144158```
145159$ vagrant up client
146160$ vagrant ssh client
@@ -196,6 +210,7 @@ You can then install the package once, and as you make changes, upload the local
196210### Compiling core, enterprise and nova on the dev machine
197211
198212Using ` cf-builder.py ` :
213+
199214```
200215$ vagrant up dev
201216$ vagrant ssh dev
@@ -204,6 +219,7 @@ $ python3 cf-builder.py --autogen --make --core --masterfiles --enterprise --nov
204219```
205220
206221The individual steps:
222+
207223```
208224$ python3 cf-builder.py --build-all --dry-run
209225
@@ -215,6 +231,7 @@ cd /northern.tech/cfengine && cd enterprise && make -j2
215231cd /northern.tech/cfengine && cd nova && ./autogen.sh --enable-debug --with-postgresql-hub=/usr
216232cd /northern.tech/cfengine && cd nova && make -j2
217233```
234+
218235(You can run the steps without using ` cf-builder.py ` , simplify the ` cd ` commands if you'd like)
219236
220237### WIP! Installing CFEngine on hub machine
@@ -224,6 +241,7 @@ Everything you're doing there should work without sudo.
224241Use the ` hub ` and ` client ` machines to install and bootstrap.
225242
226243After compiling on ` dev ` machine, use ` cf-builder.py ` to install on ` hub ` :
244+
227245```
228246$ vagrant up hub
229247$ vagrant ssh hub
@@ -253,14 +271,14 @@ vagrant up docbuildslave
253271
254272During provisioning it runs ` _scripts/provisioning-install-build-tool-chain.sh `
255273
256-
257274To perform a build log into docbuildslave and run ` starter_pack/build-docs.sh `
258275from the documentation-generator repository.
259276
260277```
261278vagrant ssh docbuildslave
262279vagrant@docbuildslave ~ $ bash /northern.tech/cfengine/documentation-generator/_scripts/starter_pack-build-docs.sh
263280```
281+
264282Browse the site in ` $NTECH_ROOT/cfengine/documentation-generator/_site/index.html `
265283
266284#### How Nick last build successfully
@@ -324,7 +342,6 @@ You should be able to open MP in your browser with the IP afterwards:
324342
325343https://192.168.56.90/
326344
327-
328345### Notes and TODOs
329346
330347The .git subdirectories get deleted during ` _run_jekyll.sh ` but I don't know
@@ -342,7 +359,7 @@ rsync -avz $NTECH_ROOT/cfengine/documentation $HOME/CFEngine/documentation/
342359There is a step in the ` create.sh ` scripts for building baseboxes where they try
343360to package the box (e.g. ` vagrant package basebox --output base.box ` ). This may
344361fail due to the VM image file not being readable for the current user. However,
345- * vagrant * even prints out the command to fix it (change the permissions) so just
362+ _ vagrant _ even prints out the command to fix it (change the permissions) so just
346363run the suggested command. Unfortunately, the ` create.sh ` script stops on this
347364so the particular step has to be run again and then all the follow-up steps have
348365to be run. It would be nice if the permissions could be fixed in advance, but
@@ -351,11 +368,12 @@ there seems to be no easy way to get the image path for a given vagrant machine.
351368### Synced folders
352369
353370vagrant-libvirt doesn't support the mechanisms for sharing folders between VMs
354- and the host system. So it either uses * rsync * to sync the folders (that's why
371+ and the host system. So it either uses _ rsync _ to sync the folders (that's why
355372we have some extra rsync options in the ` Vagrantfile ` ) or sets up NFS to share
356373the folders. However, it quite often fails to set NFS up properly, so it may be
357374necesary to enforce rsync syncing. This can be done by adding ` type: "rsync" ` to
358375the ` synced_folder ` lines. So something like this:
376+
359377```
360378- config.vm.synced_folder ".", "/vagrant",
361379+ config.vm.synced_folder ".", "/vagrant", type: "rsync",
0 commit comments