MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 2 as of 2019-05-24 22:31:04
  • Vagrant

Vagrant

  • https://www.vagrantup.com

vagrantfile

  • https://www.vagrantup.com/docs/vagrantfile/

sample file for ubuntu xenial

   1 Vagrant.configure("2") do |config|
   2   config.vm.box = "ubuntu/xenial64"
   3   config.vm.network "forwarded_port", guest: 8080, host: 18080, host_ip: "127.0.0.1"
   4   config.vm.network "forwarded_port", guest: 9990, host: 19990, host_ip: "127.0.0.1"
   5   config.vm.network "forwarded_port", guest: 9000, host: 19000, host_ip: "127.0.0.1"
   6   config.vm.network "forwarded_port", guest: 9001, host: 19001, host_ip: "127.0.0.1"
   7   config.vm.network "forwarded_port", guest: 9002, host: 19002, host_ip: "127.0.0.1"
   8   config.vm.network "forwarded_port", guest: 9003, host: 19003, host_ip: "127.0.0.1"
   9   config.vm.network "forwarded_port", guest: 4200, host: 14200, host_ip: "127.0.0.1"
  10   config.vm.network "forwarded_port", guest: 5672, host: 15672, host_ip: "127.0.0.1"
  11   config.vm.network "forwarded_port", guest: 15672, host: 25672, host_ip: "127.0.0.1"
  12   config.vm.network "forwarded_port", guest: 8000, host: 18000, host_ip: "127.0.0.1"
  13   config.vm.network "forwarded_port", guest: 5000, host: 15000, host_ip: "127.0.0.1"
  14   config.vm.network "forwarded_port", guest: 1433, host: 11433, host_ip: "127.0.0.1"
  15   config.vm.network "forwarded_port", guest: 9042, host: 19042, host_ip: "127.0.0.1"
  16   config.vm.network "forwarded_port", guest: 27017, host: 37017, host_ip: "127.0.0.1"
  17 
  18   config.vm.provider "virtualbox" do |vb|
  19     vb.gui = false
  20     vb.memory = "2048"
  21     vb.name = "UbuntuVM"
  22     file_to_disk = "dockerdata.vmdk"
  23     unless File.exist?(file_to_disk)
  24         vb.customize [ "createmedium", "disk", "--filename", file_to_disk, "--format", "vmdk", "--size", 1024 * 10 ]
  25     end
  26     vb.customize [ "storageattach", "UbuntuVM" , "--storagectl", "SCSI", "--port", "2", "--device", "0", "--type", "hdd", "--medium", file_to_disk]
  27   end
  28 
  29   config.vm.provision "shell", inline: <<-SHELL
  30     apt-get update
  31     apt-get install apt-transport-https  ca-certificates curl  software-properties-common
  32     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  33     add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  34     apt-get update
  35     apt-get install openjdk-8-jdk maven nodejs npm docker-ce -y
  36     usermod -a vagrant -G docker
  37     dd if=/dev/zero of=/swapfile1 bs=1024 count=2097152
  38     chown root:root /swapfile1
  39     chmod 0600 /swapfile1
  40     mkswap /swapfile1
  41     swapon /swapfile1
  42     echo "/swapfile1 none swap sw 0 0" >> /etc/fstab
  43     # nodejs stuff
  44     apt-get purge nodejs npm
  45     curl -sL https://deb.nodesource.com/setup_9.x | bash -
  46     apt-get install -y nodejs
  47     # prepare new disk for docker data ...
  48     echo -e "n\np\n1\n\n\nw" | fdisk /dev/sdc
  49     mkfs.ext4 /dev/sdc1
  50     mkdir -p /mnt/dockerdata
  51     mount /dev/sdc1 /mnt/dockerdata/
  52     echo "/dev/sdc1 /mnt/dockerdata ext4 defaults 0 0 " >> /etc/fstab
  53     echo -e "{\n    \"data-root\": \"/mnt/dockerdata\"\n}" > /etc/docker/daemon.json
  54   SHELL
  55 end

vagrant init

vagrant init [name [url]]

This initializes the current directory to be a Vagrant environment by creating an initial Vagrantfile if one does not already exist.
If a first argument is given, it will prepopulate the config.vm.box setting in the created Vagrantfile.
If a second argument is given, it will prepopulate the config.vm.box_url setting in the created Vagrantfile.

Create a base Vagrantfile:
$ vagrant init hashicorp/precise64

Create a minimal Vagrantfile (no comments or helpers):
$ vagrant init -m hashicorp/precise64

Create a Vagrantfile with the specific box, from the specific box URL:
$ vagrant init my-company-box https://boxes.company.com/my-company.box

vagrant up

vagrant up [name|id]
This command creates and configures guest machines according to your Vagrantfile.

centos 7

# https://app.vagrantup.com/centos/boxes/7
vagrant init centos/7
# customize the Vagrantfile
vagrant up 

Slackbuild install vagrant

   1 cd /tmp
   2 wget https://slackbuilds.org/slackbuilds/14.2/system/vagrant.tar.gz
   3 tar xvzf vagrant.tar.gz 
   4 cd vagrant
   5 wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_i686.rpm
   6 ./vagrant.SlackBuild 
   7 installpkg  /tmp/vagrant-2.2.4-i586-1_SBo.tgz
   8 vagrant -v
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01