why can't vagrant/puppet find apache? - provisioning

Here's the output on running vagrant up. Besides this, I'm not even sure what information will be helpful.
puppetlabs-apache is available in subdir: modules
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Fixed port collision for 80 => 8080. Now on port 2201.
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] -- 80 => 2201 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet/manifests
[default] -- /tmp/vagrant-puppet/modules-0
[default] Running provisioner: puppet...
Running Puppet with default.pp...
stdin: is not a tty
warning: Could not retrieve fact fqdn
warning: Host is missing hostname and/or domain: precise32
Could not find class apache for precise32 at /tmp/vagrant-puppet/manifests/default.pp:5 on node precise32
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
cd /tmp/vagrant-puppet/manifests && puppet apply --verbose --debug --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' default.pp --detailed-exitcodes || [ $? -eq 2 ]

You need to change the name of the folder from puppetlabs-apache to just apache. The module name must match the folder name.

Related

vagrant ssh get error: ssh_exchange_identification: read: Connection reset by peer

I'm installing buildroot. But when I fllow the manual from buildroot doc, the error occurred.
This is my process.
curl -O https://buildroot.org/downloads/Vagrantfile; vagrant up
And the results are as fllows.
==> default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM...
==> default: Checking if box 'ubuntu/bionic64' is up to date...
==> 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 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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
Then I try to connect with ssh
vagrant ssh
But there is northing to show. Just like this.
lt#ubuntu:~/qemu/buildroot$ vagrant ssh
So I try ssh command.
lt#ubuntu:~/qemu/buildroot$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/lt/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
ssh vagrant#127.0.0.1 -p 2222 i /home/lt/.vagrant.d/insecure_private_key
However, also northing to show.
Could you give me a sultion? Thanks.
Try performing the following commands:
vagrant halt
vagrant up
vagrant ssh
This should fix the issue. If it still persists, check your bios settings to ensure that virtualization is enabled. If your on windows, make sure hyper-v is disabled.
Its a duplicate question and answered multiple times
You can refer my answer here https://stackoverflow.com/a/62928259/6150566
Enable Virtualization by going to BIOS if you are on Windows.
If you are running VirtualBox inside a nested VM, you can enable the Virtualization settings (VT-X) by powering off the VM.

Vagrant sync folder doesn't work on windows 10

I'm trying to sync folders from a windows 10 hosto to a ubuntu guest but I get this error:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> 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: 8080 (guest) => 8080 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.36
default: VirtualBox Version: 5.0
==> default: Mounting shared folders...
default: /vagrant => C:/sync_workspace
default: /sync_workspace => C:/sync_workspace
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,nolock,vers=3 core /sync_workspace
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant`,nolock,vers=3 core /sync_workspace
The error output from the last command was:
stdin: is not a tty
unknown mount option `nolock'
valid options:
rw mount read write (default)
ro mount read only
uid =<arg> default file owner user id
gid =<arg> default file owner group id
ttl =<arg> time to live for dentry
iocharset =<arg> i/o charset (default utf8)
convertcp =<arg> convert share name from given charset to utf8
dmode =<arg> mode of all directories
fmode =<arg> mode of all regular files
umask =<arg> umask of directories and regular files
dmask =<arg> umask of directories
fmask =<arg> umask of regular files
Here is my Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.synced_folder "C:/Users/rafa/Documents/personal docs", "/vagrant_data/sync_workspace"
end
Host : Windows 10
Guest: Ubuntu
Vagrant: 1.8.1
VirtualBox : Version 5.0.20 r106931
Any Help?
Install the vagrant vaguest plugin and let it install the host's VirtualBox Guest Additions on the guest system and in your case it will update your guest addition
Also try apt-get update in your guest OS.

CoreOS: config network interface on simple machine call missing resources

I'm following official documentation of CoreOS configuration with Vagrant step by step, and when I execute command vagrant up It's present some problem on phase: Configuring and enabling network interfaces....
The output:
devops#devops-server:~/workspace/coreos-vagrant$ vagrant up
Bringing machine 'core-01' up with 'virtualbox' provider...
==> core-01: Importing base box 'coreos-alpha'...
==> core-01: Matching MAC address for NAT networking...
==> core-01: Setting the name of the VM: coreos-vagrant_core-01_1406017161344_20671
==> core-01: Fixed port collision for 22 => 2222. Now on port 2200.
==> core-01: Clearing any previously set network interfaces...
==> core-01: Preparing network interfaces based on configuration...
core-01: Adapter 1: nat
core-01: Adapter 2: hostonly
==> core-01: Forwarding ports...
core-01: 22 => 2200 (adapter 1)
==> core-01: Running 'pre-boot' VM customizations...
==> core-01: Booting VM...
==> core-01: Waiting for machine to boot. This may take a few minutes...
core-01: SSH address: 127.0.0.1:2200
core-01: SSH username: core
core-01: SSH auth method: private key
core-01: Warning: Connection timeout. Retrying...
core-01: Warning: Connection timeout. Retrying...
==> core-01: Machine booted and ready!
==> core-01: Setting hostname...
==> core-01: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mv /tmp/etcd-cluster.service /media/state/units/
Stdout from the command:
Stderr from the command:
mv: cannot move '/tmp/etcd-cluster.service' to '/media/state/units/': No such file or directory
I don't know what's the problem?
I'm authenticated on coreos vm and this machine not have resource: /media/state/units/. Why? it's normal?
The problem it's I have old version of CoreOS, currently Beta version 367.1.0 not present these problem...then I update and all work successful!.
Thanks to #RobSzumski from CoreOS-dev groups to showme the light.

Error running Vagrant on Ubuntu 12.04 on EC2

I am using Ubuntu Server 12.04.2 LTS installed on Amazon EC2, architectue x86_64 with m1.medium machine type.
To install virtualbox I did
sudo apt-get install virtualbox
Now,
vagrant init precise32 http://files.vagrantup.com/precise32.box
vagrant up
always halts saying
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'precise32' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading or copying the box...
Extracting box...te: 8240k/s, Estimated time remaining: --:--:--)
Successfully added box 'precise32' with provider 'virtualbox'!
[default] Importing base box 'precise32'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
I also see the same result ("Booting VM" forever). Looks like this is not an option for vagrant: https://github.com/mitchellh/vagrant/issues/1631
I don't see an error. It pulls down the box from the URL you gave, imports it, and starts to boot. Once it finishes booting, you should be able to vagrant ssh into the VM.
If I understand the question correctly then vagrant is stuck at "Booting VM" and never actually starts?
Try setting an environment variable to enable logging
$ VAGRANT_LOG=DEBUG vagrant up
http://docs-v1.vagrantup.com/v1/docs/debugging.html
Also, try using a different image. The precise32 image might have an older version of virtual box guest additions.

Http 404 error using Hosted Chef and Vagrant

I’m trying to get started with Chef and Vagrant and Chef is experiencing a 404 Http error when I launch the vagrant instance, full output is shown below. Does anyone have any idea?
[default] VM already created. Booting if it's not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 3000 => 3000 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] Running provisioner: Vagrant::Provisioners::ChefClient...
[default] Creating folder to hold client key...
[default] Uploading chef client validation key...
[default] Generating chef JSON and uploading...
[default] Running chef-client...
stdin: is not a tty
[Sat, 23 Jun 2012 04:46:51 -0700] INFO: Starting Chef Run
/usr/lib/ruby/1.8/net/http.rb:2101:in `error!'
:
404 "Not Found"
(
Net::HTTPServerException
)
from /usr/lib/ruby/1.8/chef/rest.rb:233:in `run_request'
from /usr/lib/ruby/1.8/chef/rest.rb:95:in `post_rest'
from /usr/lib/ruby/1.8/chef/client.rb:221:in `create_registration'
from /usr/lib/ruby/1.8/chef/client.rb:199:in `register'
from /usr/lib/ruby/1.8/chef/client.rb:73:in `run'
from /usr/lib/ruby/1.8/chef/application/client.rb:186:in `run_application'
from /usr/lib/ruby/1.8/chef/application/client.rb:178:in `loop'
from /usr/lib/ruby/1.8/chef/application/client.rb:178:in `run_application'
from /usr/lib/ruby/1.8/chef/application.rb:57:in `run'
from /usr/bin/chef-client:25
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chef-client -c /tmp/vagrant-chef-1/client.rb -j /tmp/vagrant-chef-1/dna.json
The contents of my vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid32-rvm-ruby193"
config.vm.forward_port 3000, 3000
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "https://api.opscode.com/organizations/xxx"
chef.validation_key_path = "xxx-validator.pem"
chef.validation_client_name = "xxx-validator"
end
end
That's the error you should get when you've typed the chef_server_url wrong. For example if you put:
chef.chef_server_url = "https://www.opscode.com/organizations/xxx"
Note the www instead of API, you would get that error. Had there not been a valid server to return a 404 you would get another error (probably name resolution if it's from a typo). Check the /tmp/vagrant-chef-1/client.rb file to verify it has the right URL, and double check your Vagrantfile to be sure you're using the right url.

Resources