Skip to content

Instantly share code, notes, and snippets.

@tknerr
tknerr / vagrant-up.log
Created December 16, 2014 06:38
Vagrant Chef Solo Provisioner Changes Provisioning Paths between Up and Provision
D:\Repos\_github\bills-kitchen\target\build\repo\tmp>vagrant up
Bringing machine 'foo' up with 'virtualbox' provider...
==> foo: Importing base box 'chef/ubuntu-12.04-i386'...
==> foo: Matching MAC address for NAT networking...
==> foo: Setting the name of the VM: tmp_foo_1418711517976_72019
==> foo: Clearing any previously set network interfaces...
==> foo: Preparing network interfaces based on configuration...
foo: Adapter 1: nat
==> foo: Forwarding ports...
foo: 22 => 2222 (adapter 1)
@tknerr
tknerr / cacert.pem
Created December 20, 2014 21:46
This is the cacert.pem from 20. August 2014, which still works with amazon S3. See here: https://github.com/opscode/chef-dk/issues/199
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla downloaded on: Wed Aug 20 03:12:04 2014
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
##
@tknerr
tknerr / gist:b2844befab22a5259931
Created January 17, 2015 19:24
running `bundle install` with different numer of `--jobs` and cpu cores assigned to the VM
4 jobs, 4 cpus
real 7m7.600s
user 19m12.659s
sys 3m24.444s
1 job, 4 cpus
real 11m3.151s
@tknerr
tknerr / log
Created January 18, 2015 12:18
vagrant up works, but after that the shared folder is lost and vagrant provision fails
tkn@dev-box:~/vagrant-workflow-tests/playground/sample-infrastructure-repo$ vagrant up app_v1
Bringing machine 'app_v1' up with 'lxc' provider...
==> app_v1: Using top-level cookbook 'https://github.com/tknerr/sample-toplevel-cookbook'
==> app_v1: Ensuring top-level cookbook is checked out at 'v0.2.0'
==> app_v1: Installing top-level cookbook dependencies to '/home/tkn/vagrant-workflow-tests/playground/sample-infrastructure-repo/.vagrant/toplevel-cookbooks/app_v1/cookbooks'
Resolving cookbook dependencies...
Fetching 'sample-app' from source at .
Using apt (2.4.0)
Using iptables (0.13.2)
Using apache2 (1.10.4)
@tknerr
tknerr / tasks.yml
Created February 26, 2015 09:27
Caching Oracle JDK Installation Packages dowloaded by WebUpd8 Oracle Java PPA via vagrant-cachier (Ansible Edition)
- name: Oracle Java 7 | Set Local Download Cache
debconf: name='oracle-java7-installer' question='oracle-java7-installer/local' value='/tmp/vagrant-cache/jdk' vtype='string'
@tknerr
tknerr / Vagrantfile
Created May 5, 2015 12:34
Given the below Vagrantfile the vagrant up process keeps hanging / does not return. Might have to do with the fact that `vagrant ssh -c "echo foo"` does not work either but drops us into an interactive powershell
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/eval-win7x86-enterprise-nocm"
# tell the VM to explictly use ssh and not replace keys
config.vm.communicator = :ssh
config.ssh.insert_key = false
config.vm.provision "shell", inline: "echo hello from inline"
@tknerr
tknerr / README.md
Last active February 11, 2019 19:42
Trying to get a minimal Vagrant with a Windows guest example to work...

Environment

If you are trying to reproduce this exactly, I'm using the following environment:

Basebox

First challenge is to get a windows basebox from somewhere. I couldn't find a good one, so built one myself from the windows/boxcutter packer templates:

@tknerr
tknerr / debug_no_rsync_in_path.log
Last active August 29, 2015 14:21
Output of `bundle exec vagrant provision my_windows_server > debug.log 2>&1`, see https://github.com/tknerr/vagrant-managed-servers/pull/47
Your Gemfile lists the gem vagrant-managed-servers (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
INFO global: Vagrant version: 1.7.2
INFO global: Ruby version: 2.1.5
INFO global: RubyGems version: 2.4.4
INFO global: VAGRANT_HOME="W:\\home\\.vagrant.d"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="DEBUG"
INFO global: Plugins:
@tknerr
tknerr / generate_client_key.bat
Created May 29, 2015 13:45
Generating new client key in boot2docker from a Windows host
:: see https://docs.docker.com/articles/https/
set LIBDIR=/var/lib/boot2docker/tls
b2d ssh -- sudo openssl genrsa -out %LIBDIR%/localhost_key.pem 2048
b2d ssh -- sudo OPENSSL_CONF=/usr/local/etc/ssl/openssl.cnf openssl req -subj '/CN=client' -new -key %LIBDIR%/localhost_key.pem -out %LIBDIR%/localhost_client.csr
b2d ssh -- echo extendedKeyUsage = clientAuth ^| sudo tee %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo openssl x509 -req -days 365 -in %LIBDIR%/localhost_client.csr -CA %LIBDIR%/ca.pem -CAkey %LIBDIR%/cakey.pem -CAcreateserial -out %LIBDIR%/localhost_cert.pem -extfile %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo rm %LIBDIR%/localhost_client.csr %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo cat %LIBDIR%/localhost_key.pem > %HOME%\.boot2docker\certs\boot2docker-vm\localhost_key.pem
@tknerr
tknerr / portforward.bat
Created May 29, 2015 14:22
Set up port forwarding of boot2docker via localhost
:: set up port forwarding to make the docker host work via our weird VPN, too
echo port-forwarding docker port 2376 via localhost...
VBoxManage controlvm "boot2docker-vm" natpf1 delete "tcp-port2376" >NUL 2>&1
VBoxManage controlvm "boot2docker-vm" natpf1 "tcp-port2376,tcp,,2376,,2376"
set DOCKER_HOST=tcp://127.0.0.1:2376