Vagrant

Post tags: | linux | ubuntu_linux | vagrant | virtualbox |

log

Install latest virtualbox

Install latest virtualbox
        wget http://download.virtualbox.org/virtualbox/4.3.26/virtualbox-4.3_4.3.26-98988~Debian~wheezy_amd64.deb
        sudo dpkg -i virtualbox-4.3_4.3.26-98988~Debian~wheezy_amd64.deb
        

Install vagrant

installation

http://www.vagrantup.com/downloads Below are all available downloads for the latest version of Vagrant (1.7.2).

https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb

vagrant o4g31.coot.local

vagrant o4g31.coot.local
        mkdir ~/dev/vagrant-o4g31.coot.local
        cd ~/dev/vagrant-o4g31.coot.local
        git init .
        vagrant init ubuntu/trusty64
        
config.vm.box = "ubuntu/trusty64"
        
vagrant up
        /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/lib/vagrant/pre-rubygems.rb:31: warning: Insecure world writable dir /opt/java in PATH, mode 040777
        /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /opt/java in PATH, mode 040777
        Bringing machine 'default' up with 'virtualbox' provider...
        ==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
            default: Box Provider: virtualbox
            default: Box Version: >= 0
        ==> default: Loading metadata for box 'ubuntu/trusty64'
            default: URL: https://atlas.hashicorp.com/ubuntu/trusty64
        ==> default: Adding box 'ubuntu/trusty64' (v14.04) for provider: virtualbox
            default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box
        ==> default: Successfully added box 'ubuntu/trusty64' (v14.04) for 'virtualbox'!
        ==> default: Importing base box 'ubuntu/trusty64'...
        ==> default: Matching MAC address for NAT networking...
        ==> default: Checking if box 'ubuntu/trusty64' is up to date...
        ==> default: Setting the name of the VM: vagrant-o4g31cootlocal_default_1429027337806_5579
        ==> default: Clearing any previously set forwarded ports...
        ==> default: Clearing any previously set network interfaces...
        ==> default: Preparing network interfaces based on configuration...
            default: Adapter 1: nat
        ==> default: Forwarding ports...
            default: 22 => 2222 (adapter 1)
        ==> default: Booting VM...
        ==> default: Waiting for machine to boot. This may take a few minutes...
            default: SSH address: 127.0.0.1:2222
            default: SSH username: vagrant
            default: SSH auth method: private key
            default: Warning: Connection timeout. Retrying...
            default: 
            default: Vagrant insecure key detected. Vagrant will automatically replace
            default: this with a newly generated keypair for better security.
            default: 
            default: Inserting generated public key within guest...
            default: Removing insecure key from the guest if its present...
            default: Key inserted! Disconnecting and reconnecting using new SSH key...
        ==> default: Machine booted and ready!
        ==> default: Checking for guest additions in VM...
        ==> default: Mounting shared folders...
            default: /vagrant => /home/craig/dev/vagrant-o4g31.coot.local
        
        vboxmanage list runningvms
        "vagrant-o4g31cootlocal_default_1429027337806_5579" {9793abb6-75a6-4905-a085-1da3d7f4e237}
        

jump into ansible provisioning

http://docs.vagrantup.com/v2/provisioning/ansible.html

Ansible provisioner

hostname, fqdn

https://galaxy.ansible.com/list#/roles/528

ansible-galaxy install ANXS.hostname

rbenv

ansible-galaxy install zzet.rbenv

https://galaxy.ansible.com/list#/roles/102

ansible-galaxy install znzj.rbenv

https://galaxy.ansible.com/list#/roles/968

Adam Brett - Vagrant & Ansible Quickstart Tutorial

adamcod.es Vagrant & Ansible Quickstart Tutorial

Research

scotch.io/tutorials/ Getting Started with Vagrant Push

scotch.io/tutorials/ Get VAGRANT UP and Running in No Time

servercheck.in/blog/ Building VM images with Ansible and Packer

servercheck.in/blog/ Building VM images with Ansible and Packer

Building VM images with Ansible and Packer

You can drastically cut down on per-server provisioning time by using custom-made ‘boxes’ or ‘images’ that can be deployed instead of default OS installed. Think of these as preconfigured OS instances that might just need a little extra configuration per-instance, or would need a few files updated after the instance is built.

It just so happens there’s a tool built to help you do just this—create boxes (for Vagrant), AMIs (for AWS) or images (for Digital Ocean or other services)—called Packer. Packer can even build images for multiple providers using multiple provisioners (like shell scripts, Ansible playbooks, Salt states, Chef cookbooks, Puppet manifests or other popular provisioners), all with one set of configuration and instructions.

In this blog post, I’ll show you how to build a Vagrant Box file for CentOS 6.5 using Packer with Ansible and a couple simple shell scripts.

docs.vagrantup.com/v2/ vagrantfile

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code, run vagrant up, and be on their way. Vagrantfiles are portable across every platform Vagrant supports.

docs.vagrantup.com/v2/ virtualbox support

docs.vagrantup.com/v2/ Creating a Base Box

https://atlas.hashicorp.com/boxes/search

https://atlas.hashicorp.com/ubuntu/boxes/trusty64

virtualbox self-hosted vagrant up ubuntu/trusty64 –provider virtualbox

http://releases.ubuntu.com/14.04/ Ubuntu 14.04.2 LTS (Trusty Tahr)

docs.vagrantup.com/v2/ Getting Started

Ansible research

https://galaxy.ansible.com/