OSX Vagrant notes to take along the way as I get beaker working with boxen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEAKER_debug=true bundle exec rspec spec/acceptance/ini_setting_spec.rb | |
| /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/beaker-rspec-5.0.1/lib/beaker-rspec/helpers/serverspec.rb:43: warning: already initialized constant Module::VALID_OPTIONS_KEYS | |
| /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/specinfra-2.12.3/lib/specinfra/configuration.rb:4: warning: previous definition of VALID_OPTIONS_KEYS was here | |
| Hypervisor for freebsd-9-x64 is vagrant | |
| Beaker::Hypervisor, found some vagrant boxes to create | |
| ==> freebsd-9-x64: VM not created. Moving on... | |
| created Vagrantfile for VagrantHost freebsd-9-x64 | |
| Bringing machine 'freebsd-9-x64' up with 'virtualbox' provider... | |
| ==> freebsd-9-x64: Importing base box 'freebsd-9-x64-vbox'... | |
| ==> freebsd-9-x64: Matching MAC address for NAT networking... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Vagrant.configure("2") do |c| | |
| c.vm.define 'win-2008R2-std' do |v| | |
| v.vm.hostname = 'win-2008R2-std' | |
| v.vm.box = 'opentable/win-2008r2-standard-amd64-nocm' | |
| v.vm.box_check_update = 'true' | |
| v.vm.network :private_network, ip: "10.255.174.15", :netmask => "255.255.0.0", :mac => "080027E855B5" | |
| v.vm.network :forwarded_port, guest: 3389, host: 3389 | |
| v.vm.network :forwarded_port, guest: 5985, host: 5985, id: 'winrm', auto_correct: true | |
| v.vm.guest = :windows | |
| v.vm.provider :virtualbox do |vb| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Start-ProcessAsAdmin( | |
| [string] $FilePath, | |
| [string] $Arguments) | |
| { | |
| if ($FilePath -match ".*powershell") | |
| { | |
| $Arguments = "-NoProfile -ExecutionPolicy Unrestricted -Command `"$Arguments`"" | |
| } | |
| $process = New-Object System.Diagnostics.Process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set-ExecutionPolicy Unrestricted -Force | |
| function Start-ProcessAsAdmin( | |
| [string] $FilePath, | |
| [string] $Arguments) | |
| { | |
| if ($FilePath -match ".*powershell") | |
| { | |
| $Arguments = "-NoProfile -ExecutionPolicy Unrestricted -Command `"$Arguments`"" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package { 'WinRAR 5.21 beta 2 (64-bit)': | |
| ensure => absent, | |
| uninstall_options => ['/S'], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo /usr/sbin/groupadd vagrant | |
| sudo /usr/sbin/useradd vagrant -g vagrant -G wheel | |
| echo "vagrant" | sudo passwd --stdin vagrant | |
| echo "vagrant ALL=(ALL) NOPASSWD: ALL" |sudo tee /etc/sudoers.d/vagrant 1>/dev/null | |
| sudo chmod 0440 /etc/sudoers.d/vagrant | |
| sudo mkdir -m 700 /home/vagrant/.ssh | |
| sudo touch /home/vagrant/.ssh/authorized_keys | |
| echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" | sudo tee /home/vagrant/.ssh/authorized_keys 1>/dev/null | |
| sudo chmod 600 /home/vagrant/.ssh/authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_swap_files(file_path) | |
| begin | |
| output = swapon(['-s']) | |
| rescue Puppet::ExecutionFailure => e | |
| Puppet.debug("#get_swap_files had an error -> #{e.inspect}") | |
| return nil | |
| end | |
| swapfiles = output.split("\n").sort | |
| swapfiles.include?(file_path) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HOSTS: | |
| ubuntu-12042-x64: | |
| roles: | |
| - master | |
| - database | |
| - dashboard | |
| platform: ubuntu-12.04-amd64 | |
| box: ubuntu-server-12042-x64-vbox4210-nocm | |
| box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box | |
| hypervisor: vagrant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vagrant:~ vagrant$ java | |
| No Java runtime present, requesting install. | |
| vagrant:~ vagrant$ /usr/libexec/java_home --failfast | |
| Unable to find any JVMs matching version "(null)". | |
| vagrant:~ vagrant$ |