Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created May 24, 2011 18:12
Show Gist options
  • Select an option

  • Save glarizza/989293 to your computer and use it in GitHub Desktop.

Select an option

Save glarizza/989293 to your computer and use it in GitHub Desktop.
Vagrant Failure
##Error
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1
The output of the command prior to failing is outputted below:
sed: can't read /etc/sysconfig/network-scripts/ifcfg-eth1: No such file or directory
##Vagrantfile
Vagrant::Config.run do |config|
# Change this box name depending on the system you want.
#box = "squeeze64"
box = "centos5_64"
#box = "rhel60_64"
#box = "centos4_64"
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = box
config.vm.box_url = "http://puppetlabs.s3.amazonaws.com/pub/#{box}.box"
config.vm.customize do |vm|
#vm.memory_size = 128 # Bumped this up since I'm only doing 2 nodes - for my own sanity.
vm.memory_size = 512
vm.cpu_count = 1
end
('a'..'b').each do |element|
meta_vm = {
'ip' => '192.168.56.' + (element.sum(5) + 9).to_s,
'name' => element + 'server',
'vm' => element.to_sym
}
config.vm.define meta_vm['vm'] do |avm|
#avm.vm.network(meta_vm['ip'], :adapter => 1, :name => 'vboxnet0') # NOTE: This fails with RHEL - network name.
avm.vm.network(meta_vm['ip'], :adapter => 1)
avm.vm.host_name = meta_vm['name']
# This will provision the box using puppet
Vagrant::Config.run do |subconfig|
subconfig.vm.provision :puppet do |puppet|
puppet.options = "-v --vardir=/var/lib/puppet --ssldir=/var/lib/puppet/ssl --certname=#{meta_vm['name']}"
puppet.module_path = "modules"
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
end
end
end
end
end
# vim: set filetype=ruby :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment