[chef] calling providers without arguments


Chronological Thread 
  • From: gregory grey < >
  • To:
  • Subject: [chef] calling providers without arguments
  • Date: Wed, 18 Feb 2015 10:37:17 +0100

Hi guys,

I'm new to Chef, get a bestpractice question.

When using custom provider, which looks like this:

action :upt do
         command="uptime"
end

...if I call it with

testcookbook_testprovider do
        action :upt
end

I get an error,  "You must supply a name when declaring a testcookbook_testprovider resource".

So for now I call my resource with

testcookbook_testprovider "foo" do
        action :upt
end

...which is kinda ugly. How do I overcome the need in passing "foo", when I don't really need any agruments for running my provider?


Thanks,
Greg



Archive powered by MHonArc 2.6.16.

§