Recipe "DNA and genesis of a Vagrant Box ("VBubuntu") ready for hosting a SMW"

From SMW CindyKate by dataspects
Component 998878
Jump to navigation Jump to search
[edit]
Keywords/Contexts

Ansible · Packer · Vagrant

Annotations
{{#compound_query:Component 998878Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.UseCaseMotivation;?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning
Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.Recipe "DNA and genesis of a Vagrant Box ("VBubuntu") ready for hosting a SMW";?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning Property "-Has subobject" has a restricted application area and cannot be used as annotation property by a user.Recipe "DNA and genesis of a Vagrant Box ("VBubuntu") ready for hosting a SMW";?HasDirection;?IsMotivating;?IsMotivatedBy;?HasReasoning
name=MotivationsDeclaredOnThisPageResultItem|link=none}}
Motivations
Lua error in Module:Motivations at line 23: attempt to concatenate field 'hasReasoning' (a nil value).
[edit]

Content


This recipe explains the steps for creating a VirtualBox .ova on the way towards the Vagrant Box mentioned.

Use Hashicorp Packer to build a VirtualBox .ova file already containing a maximum of setup, provisioning and configuration in view of its purpose of hosting a SMW system

Packer Template "template.json"

Packer Template Key "builders" (Array)

Array[0]

Packer Template Key "provisioners" (Array)

Array[0]

Array[1]

Build

git clone git@github.com:dataspects/dataspectsStandardSMWHostingUbuntuVagrantBoxPackerFactory.git
cd dataspectsStandardSMWHostingUbuntuVagrantBoxPackerFactory
packer validate template.json
PACKER_CACHE_DIR=~/packer_cache/ ./pack_now.sh

This creates a .ova at OUTPUT_DIRECTORY.

Import .ova into VirtualBox

  1. VM VirtualBox Manager > Ctrl+I
  2. Run VBoxManage list vms to get the corresponding VMID

Apply some manual finishing to the VirtualBox VM (notably aspects that somehow fail to run within the Packer build context)

Notice:

This is pragmatic behaviour. Of course these aspects shall be solved and moved into the Packer build context.

  • sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  • Some PEAR/PECL package insstallations

Convert VirtualBox VM into Vagrant Box

vagrant package --base VMID --output ~/dataspectsStandardSMWHostingUbuntuVBVM.box

Add dataspectsStandardSMWHostingUbuntuVBVM for local testing

  1. Create a folder named vagrant_test_dataspectsStandardSMWHostingUbuntuVagrantBox
  2. Run vagrant box add --name dataspectsStandardSMWHostingUbuntuVagrantBox ~/dataspectsStandardSMWHostingUbuntuVBVM.box
  3. Run vagrant_test_dataspectsStandardSMWHostingUbuntuVagrantBox$ vagrant init and edit Vagrantfile to use dataspectsStandardSMWHostingUbuntuVagrantBox
  4. Run vagrant_test_dataspectsStandardSMWHostingUbuntuVagrantBox$ vagrant up

Make dataspectsStandardSMWHostingUbuntuVagrantBox.box available at https://app.vagrantup.com/dataspects/boxes/dataspectsStandardSMWHostingUbuntuVagrantBox

  1. Upload dataspectsStandardSMWHostingUbuntuVagrantBox.box to /srv/ftp
  2. Create box and/or release version at https://app.vagrantup.com/dataspects/boxes