-
-
Save chef/185066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tempfile' | |
require 'chef/provider/script' | |
class Chef | |
class Provider | |
class ErlCall < Chef::Provider::Script | |
def action_run | |
case @new_resource.name_type | |
when "sname" | |
node = "-sname #{@new_resource.node_name}" | |
when "name" | |
node = "-name #{@new_resource.node_name}" | |
end | |
if @new_resource.cookie | |
cookie = "-c #{@new_resource.cookie}" | |
else | |
cookie = "" | |
end | |
super | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/resource/script' | |
class Chef | |
class Resource | |
class ErlCall < Chef::Resource::Script | |
def initialize(name, collection=nil, node=nil) | |
super(name, collection, node) | |
@resource_name = :erl_call | |
@interpreter = "erl_call" | |
@cookie = nil | |
@node_name = "chef@localhost" | |
@name_type = "sname" | |
end | |
def cookie(arg=nil) | |
set_or_return( | |
:cookie, | |
arg, | |
:kind_of => [ String ] | |
) | |
end | |
def node_name(arg=nil) | |
set_or_return( | |
:name, | |
arg, | |
:kind_of => [ String ] | |
) | |
end | |
def name_type(arg=nil) | |
set_or_return( | |
:sname, | |
arg, | |
:kind_of => [ String ] | |
) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment