1

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!

Jack Amoratis
  • 653
  • 2
  • 7
  • 22

2 Answers2

5

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.

Chris Pitman
  • 12,990
  • 3
  • 41
  • 56
  • Thanks, Chris - but specifically what steps do I need to take? – Jack Amoratis Mar 30 '14 at 23:22
  • 1
    @user3078326 You need to set `puppet.module_path` to where your modules are, in your case `"manifests\modules"`. – Chris Pitman Mar 31 '14 at 03:51
  • Thank you very much! I appreciate this correct answer. Just a thought, but I would encourage adding the info from your comment into the original answer. It hit the nail right on the head. Thank you again. – Jack Amoratis Mar 31 '14 at 06:49
  • Puppet wasnt picking the module path for some reason in spite of me trying to set `puppet.module_path`. Finally an alternative way at http://stackoverflow.com/a/17864977/3143538 helped me solve the problem – Tushar Goswami Mar 26 '16 at 10:19
0

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

rojs
  • 649
  • 3
  • 5
  • Just curious if you have looked at the git repo? I appreciate the response, but it is missing information. Yes, the git class is in modules as a folder so I think your response is not accounting for that. But I am very grateful for your attempt. – Jack Amoratis Mar 24 '14 at 04:40
  • Just curious if you have tried to vagrant up my repo at the github link I provided at https://github.com/jamorat/puppet-example That is where you can see the actual pp and the actual directory structure (where the git module is.) – Jack Amoratis Mar 24 '14 at 04:49
  • Ah, was only going on what was here. Check your puppet.conf. It should have a manifests and modules setting telling where it can find each. Normally it's /etc/puppet/manifests and /etc/puppet/modules. site.pp goes in the manifests directory, git module in the modules directory. The error message is definitely saying it cant find the git module. – rojs Mar 24 '14 at 22:44
  • Have you been able to `vagrant up` my actual example? Yes, the error message is saying it can't find the git module - although it does seem to be looking for it in the correct place. I have confirmed the module seems to be where it is being sought. I appreciate that you have taken the time to write a response, but it's a general theory guess and maybe is not really addressing this specific issue. – Jack Amoratis Mar 26 '14 at 00:42
  • "Seems to be where it is being sought" is obviously not happening b/c it can't find it. module path can be set on the command line also, which I suspect is where the failure is at. Taking a peak at your vagrant file on github I see a manifests path being set but no module path. No module path -- no way to find it. – rojs Mar 29 '14 at 15:10
  • Thanks rojs. Would you be able to provide any more specific details? What code changes or additions specifically would make this work? Thanks! – Jack Amoratis Mar 29 '14 at 19:28
  • You were on the right subject with the module path, but it took me asking the question again for me to know what you meant by that. Someone else answered my question and they actually explained where to put module_path, and that made all the difference. I appreciate your contribution very much, but as a newer author of puppets I did not get the specific information from your answer which I needed to fix the problem. I would like to award the correct answer here but I just can't because I don't think it would help someone else with the same issue. – Jack Amoratis Mar 31 '14 at 07:02