Ask Your Question
0

Invalid package provider chocolatey

asked 2015-03-12 09:52:50 -0500

eliassal gravatar image

I have a puppet master working fine and using roles and profiles with a windows machine I tried to use puppet-chocolatey

added the Choclatey module to puppet master

 puppet module install rismoney-chocolatey

Then updated the roles init.pp with

class { 'profiles::windows::notepadplusplus':}

Updated the profiles init.pp with

class profiles::windows::notepadplusplus {
  package { 'notepadplusplus':
    ensure    => '6.5.1',
    provider        => 'chocolatey'
    source          => 'https://chocolatey.org/packages/notepadplusplus.install/6.5.1',
  }

I get the following error when running the agent

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class profiles::windows::notepadplusplus at /etc/puppet/environments/ production/modules/roles/manifests/init.pp:46 on node slave1.mydomain.net Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run I am not able to find any link or contact or support to ask about this issue. Thanks in advance for your help

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-03-13 04:07:27 -0500

PorkCharSui gravatar image

You've declared a class { 'profiles::windows::notepadplusplus':} in your roles manifest, that won't work. You should declare a class role::something and include the class profiles::something::something. Something like this:

class roles::windows {
    include profiles::windows::notepadplusplus
}
edit flag offensive delete link more
0

answered 2015-03-13 14:34:33 -0500

eliassal gravatar image

Thanks PorkCharSui for your response. before adding this class, I had the following in the roles initi.pp which worked fine

roles init.pp

class roles::windows-admin {  
 class { 'profiles::windows::mysql-workbench': }
  class { 'profiles::windows::putty': }
  }

profiles init.pp

class profiles::windows::putty {

  file { 'c:/localbin/':
    ensure => 'directory',
  }

  download_file { "Download putty":
    url                   => 'http://the.earth.li/~sgtatham/putty/latest/x86/pu$
    destination_directory => 'c:\localbin',
  }

   download_file { "Download puttygen":
   url                    => 'http://the.earth.li/~sgtatham/putty/latest/x86/pu$
   destination_directory  => 'c:\localbin',
  }

}

so what I did is I added

class { 'profiles::windows::notepadplusplus':}

to roles init.pp

then added the following to the profiles init.pp

class profiles::windows::notepadplusplus { package { "notepadplusplus": ensure => '6.5.1', provider => 'chocolatey', source => 'https://chocolatey.org/packages/notepadplusplus.install$

}

Is there any difference, can you please explain why I need to use your syntx, is it because of some specifics to Chocolatey Thanbks again

edit flag offensive delete link more

Comments

Your notation is correct and should work as long as it is within your "class roles::windows-admin {" in the "roles/init.pp", but that I couldn't see in your initial question.

PorkCharSui gravatar imagePorkCharSui ( 2015-03-16 05:19:47 -0500 )edit

It's puppet's name spacing, "profiles::windows::notepadplusplus" compares to a directory structure ".../modules/profiles/manifests/windows/notepadplusplus.pp" the "::" could be seen as a "/" or "\" (on windows).

PorkCharSui gravatar imagePorkCharSui ( 2015-03-16 05:29:17 -0500 )edit

So what I need to do in order to make it work?

eliassal gravatar imageeliassal ( 2015-03-17 09:56:47 -0500 )edit

Can somebody respond to this? I understand that there is a good community behind the puppet? it has been more than 2 weeks and not being able to progress on this

eliassal gravatar imageeliassal ( 2015-03-22 11:42:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-03-12 09:52:50 -0500

Seen: 608 times

Last updated: Mar 13 '15