Hello Chef Masters!
Im trying to write an example of custom resource with the 'load_current_value' method and I dont understand why 'new_resource' is null inside the method:
resource_name :resexample
property :path, String, name_property: true
property :content, String
property :mode, String
load_current_value do
if ::File.exist?(new_resource.path)
content IO.read(new_resource.path)
mode ::File.stat(new_resource.path).mode
end
end
action :create do
converge_if_changed :content do
IO.write(new_resource.path, new_resource.content)
end
converge_if_changed :mode do
::File.chmod(new_resource.mode, new_resource.path)
end
end
Anyone know what could be the reason that new_resource inside the load_current_value is null?
thanks in advance for your help!
Mauri