Vagrant Puppet Class Not Found Error

拥有回忆 提交于 2019-12-11 10:26:38

问题


I am getting the message:

Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class git at /tmp/vagrant-puppet-1/manifests/site.pp:15 on node vagrant-ubuntu-precise-64.wp.comcast.net

Probably the best idea is to see this in action. I have created a GitHub repo of the exact manifest I am using. It is here: https://github.com/jamorat/puppet-example

The manifests and git module are there. If you have Vagrant, this can be vagrant up and you will see the error for yourself. Would be cool to either receive an answer here and/or also as a commit (for which credit would still be given here for answer.)

Thank you so much!


回答1:


You need to configure vagrant with the puppet module path. On a side note, you would also usually keep the manifest and module folder in the same folder, instead of modules inside manifests.




回答2:


This:

class{ git:
svn => 'installed',
gui => 'installed',
}

is telling puppet to create a resource based on the class named git that has 2 parameters: svn and gui. Such a class declaration doesn't exist anywhere in what you've posted. If it were, it would look something like:

class git ($svn, $gui) {

  package {'svn':
    ensure => $svn,
  }

  # Whatever 'gui' is, making package b/c use of "installed"
  package {'gui':
    ensure => $gui,
  }
}

Alternative is to declare a class and include it using the "include" directive.

Recommend a good reading of Language: Classes



来源:https://stackoverflow.com/questions/22676511/vagrant-puppet-class-not-found-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!