[chef] Re: Re: Re: xslt templates


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: xslt templates
  • Date: Tue, 1 Jul 2014 09:35:03 -0700

i am using similar logic(xml & xslt) for creating jenkins configs using lwrp. the resource declaration looks like this:

xml_file '/var/lib/jenkins/config/org.jenkinsci.plugins.ghprb.GhprbTrigger.xml' do
  mappings('//adminlist' => @github_users.join("\n"))
  source 'ghprb_config.xml.erb'
  notifies :restart, 'service[jenkins]'                                    
end

internally it uses file resource for content/ownership etc and nokogiri for xml/xslt stuff. mappings is an array of key/value pairs  (selector -> expected value) used to pass xslt targets. this is idempotent and why_run compliant.

regards
ranjib


On Tue, Jul 1, 2014 at 9:13 AM, < " target="_blank"> > wrote:
You are right about the idempotent, and my example does not show that. I use
"action :nothing" and notifications to trigger the generation.
I am not so happy about it, it does not show a diff as "template" does and
xsltproc runs on the target.
I may eventually try to implement your LWRP suggestion

Thanks




Archive powered by MHonArc 2.6.16.

§