PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 15, 2022

[FIXED] Vagrant on Windows 7 64bit: Could not match ? at /tmp/vagrant-puppet/manifests/default.pp:2 on node lucid32.hsd1.ca.comcast.net

 March 15, 2022     host, lamp, vagrant, windows-7     No comments   

Issue

Attempting to Boot and provision a LAMP VM with Vagrant and Virtual box running on a Windows 7 64 bit host. But am getting the error message:

Could not match ? at /tmp/vagrant-puppet/manifests/default.pp:2 on node lucid32.hsd1.ca.comcast.net.

Searches don't find any helpful clues - they are unrelated to using Vagrant and discuss completely different scenarios.

C:\Users\rdavis\lamp-project>vagrant up
[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] -- 80 => 8080 (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] -- configs: /configs
[default] -- manifests: /tmp/vagrant-puppet/manifests
[default] Running provisioner: Vagrant::Provisioners::Puppet...
[default] Running Puppet with /tmp/vagrant-puppet/manifests/default.pp...
stdin: is not a tty
Could not parse for environment production: Could not match ? at /tmp/vagrant-puppet/manifests/default.pp:2 on node lucid32.hsd1.ca.comcast.net.

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 /tmp/vagrant-puppet/manifests/default.pp --detailed-exitcodes || [ $? -eq 2 ]

C:\Users\rdavis\lamp-project>

(A sub question, out of curiosity is: What is lucid32.hsd1.ca.comcast.net ?! This looks like a valid URL (but doesn't actually work (404)) - So what's it for?)

My setup:

  • Windows 7 64 bit
  • Installed VirtualBox
  • Installed Vagrant
  • Installed Puppet: https://downloads.puppetlabs.com/windows/
  • Installed Ruby: http://rubyinstaller.org/

Issued command:

vagrant box add base http://files.vagrantup.com/lucid32.box

Then attempted to setup a LAMP VM in a Windows 7 64 bit host based on: http://ox86.tumblr.com/post/23734821654/painless-development-environments-with-virtualbox

...as follows:

mkdir lamp-project
cd lamp-project
C:\Users\rdavis\lamp-project>mkdir configs
C:\Users\rdavis\lamp-project>mkdir manifests
C:\Users\rdavis\lamp-project>vagrant init

Edited Vagrantfile inserted the following directly after Vagrant::Config.run do |config|

config.vm.box = “lucid32”
config.vm.provision :puppet do |puppet|
   puppet.manifests_path = File.expand_path(“../manifests”, __FILE__)
end
config.vm.forward_port 80, 8080
config.vm.share_folder “configs”, “/configs”, File.expand_path(“../configs”, __FILE__)

Then created a default.pp puppet file (again, from reference 1 ) and put in the manifests folder as that reference 1 instructs

$config_path = "/configs”
$vagrant_base_path = "/vagrant”
Exec { path => "/bin:/usr/bin:/usr/local/bin” }
group { "puppet”: ensure => present }
exec { "apt-get update”: command => "apt-get update” }
class apache {
    file { "/etc/apache2/sites-enabled/000-default":
        ensure => file,
        source => "${config_path}/000-default",
        before => Service["apache2"],
    }
    exec { "enable-mod_rewrite":
        require => Package["apache2"],
        before => Service["apache2"],
        command => "/usr/sbin/a2enmod rewrite"
    }
    package { "apache2":
        ensure => present,
        before => File["/etc/apache2/sites-enabled/000-default"],
    }

    service { "apache2":
        ensure => running,
        require => Package["apache2"]
    }
}
class php {
    package { "libapache2-mod-php5": ensure => present }
    package { "php5": ensure => present }
    package { "php5-cli": ensure => present }
    package { "php5-dev": ensure => present }
    package { "php5-mysql": ensure => present }
    package { "php-pear": ensure => present }
    exec { "pear upgrade":
        command => "/usr/bin/pear upgrade",
require => Package["php-pear"],
    }
}
class mysql {
  package { "mysql-server":
    require => Exec["apt-get update"],
    ensure => present,
  }
  service { "mysql":
    enable => true,
    ensure => running,
    require => Package["mysql-server"],
  }
  exec { "Set MySQL server root password":
        require => Package["mysql-server"],
        unless => "/usr/bin/mysqladmin -uroot -proot status",
        command => "/usr/bin/mysqladmin -uroot password root",
  }
}
include apache
include php
include mysql

Updated Some invalid quoting e.g. see line $vagrant_base_path = "/vagrant”

All instances of ” have been corrected to "


Solution

Some invalid quoting e.g. see line $vagrant_base_path = "/vagrant”

All instances of ” have been corrected to "



Answered By - therobyouknow
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing