On Wednesday, March 20, 2013 at 6:13 AM, Sean OMeara wrote:
Hi.Just stick "use_inline_resources" at the top of your provider definition.-sOn Wed, Mar 20, 2013 at 8:31 AM, < "> > wrote:I observed that in case of LWRP, "notifies" clause don't work as expected (i.e.it doesn't notify other resource with given action). Please let me know ifthere are any mistakes in the code.I declared LWRP as -resources/execute.rb-----------------------------------actions :executeattribute :name, :kind_of => String, :name_attribute => trueattribute :command, :kind_of => Stringproviders/remote.rb-----------------------------------action :execute doexecute "remote_exe_#{new_resource.command}" docommand "#{new_resource.command}"endendrecipes/default.rb------------------------------------------Remote_execute "lwrp_uninst" do <<<< cookbook name => Remotecommand "sudo rpm -e libyaml-0.1.4-1ll.el6.rf.x86_64"action :nothingprovider "Remote_remote" <<<< cookbook name =>RemoteendRemote_execute "lwrp_inst" do <<<< cookbook name =>Remotecommand "sudo rpm -ivh/home/aditya/Downloads/libyaml-0.1.4-1.el6.rf.x86_64.rpm"action :executeprovider "Remote_remote" <<<< cookbook name =>Remotenotifies :execute, "Remote_execute[lwrp_uninst]", :immediatelyend===============================================================If I try same thing with existing resource e.g. "execute", it works asexpected.execute "uninstall" docommand "sudo rpm -e libyaml-0.1.4-1.el6.rf.x86_64"action :nothingendexecute "install" docommand "sudo rpm -ivh/home/aditya/Downloads/libyaml-0.1.4-1.el6.rf.x86_64.rpm"notifies :run, "execute[uninstall]", :immediatelyendThanks,Aditya Nitsure
Archive powered by MHonArc 2.6.16.