无法运行 vagrant,出现“在节点 vagrant.vm 上找不到 vagrant.vm 的 php 类”

无法运行 vagrant,出现“在节点 vagrant.vm 上找不到 vagrant.vm 的 php 类”

我从另一个开发人员那里继承了一个 Web 项目,它是用 Laravel 构建的并且设置为使用 Vagrant。

我已经安装了最新的 Vagrant,运行时vagrant up它会按照常规步骤运行,直到抛出以下错误:

==> default: Running Puppet with default.pp...
==> default: Error: Could not find class php for vagrant.vm on node vagrant.vm
==> default: Error: Could not find class php for vagrant.vm on node vagrant.vm
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

我的default.pp文件如下:

    ensure => present,
}

exec { 'apt-get update':
    command => '/usr/bin/apt-get update',
}

# Include our classes
hiera_include('classes')

package { 'nano':
    ensure => present,
    require => Exec['apt-get update'],
}

# Set up nginx
package { 'nginx':
    ensure => present,
    require => Exec['apt-get update'],
}

service { 'nginx':
    ensure => running,
    require => Package['nginx'],
}

file { 'default-nginx-disable':
    path => '/etc/nginx/sites-enabled/default',
    ensure => absent,
    require => Package['nginx'],
}

file { 'nginx-vhost':
    path => '/etc/nginx/sites-available/vhost.conf',
    source => 'puppet:///modules/nginx/vhost',
    require => File['default-nginx-disable']
}

file { 'vagrant-nginx-enable':
    path => '/etc/nginx/sites-enabled/vhost.conf',
    target => '/etc/nginx/sites-available/vhost.conf',
    ensure => link,
    notify => Service['nginx'],
    require => [
        File['nginx-vhost'],
    ],
}

class { '::mysql::server':
    root_password => 'mysqlpass'
}

class { '::mysql::bindings':
    php_enable => true
}

class { 'elasticsearch':
    java_install => true,
    manage_repo  => true,
    repo_version => '5.x'
}

elasticsearch::instance { 'es-01': }

相关内容