Re: [Puppet Users] Dynamic file content?

2017-11-20 Thread Martin Alfke
Hi Chris, no worries, I hope that I didn’t offend you. Usually I try to tell people the best solution first and go for hacks afterwards. This allows them to first learn about the concepts. Best, Martin > On 20 Nov 2017, at 05:38, Chris Denneen wrote: > > Martin, > Obviously with templates be

Re: [Puppet Users] Dynamic file content?

2017-11-19 Thread Chris Denneen
Martin, Obviously with templates being my first and last recommendation the Exec wasn’t my choice either but there are always different ways to skin a cat and not knowing why the OP hasn’t used them could be because they aren’t an option, I obviously hope not but without knowing background I wa

Re: [Puppet Users] Dynamic file content?

2017-11-18 Thread Martin Alfke
Hi Chris, > On 18 Nov 2017, at 15:07, Chris Denneen wrote: > > Can you use an ERB template to construct the changes you require rather than > augeas? There is a new template engine since Puppet 4: EPP (Embedded Puppet) This prevents people from doing weird ruby stuff in a file. Templates shoul

[Puppet Users] Dynamic file content?

2017-11-18 Thread Chris Denneen
Can you use an ERB template to construct the changes you require rather than augeas? If not another suggestion would be 1 file resource from src to temp location, which only gets updated when src changes. An Exec that is refreshonly that copies from temp to dest (which is notified by file resour

Re: [Puppet Users] Dynamic file content

2017-11-18 Thread Martin Alfke
Hi Dave, > On 17 Nov 2017, at 16:21, Dave F wrote: > > Hi > […] > I'm doing this by > > a) using a file resource to put the xml file in place > b) Using Augeas to search and replace a value within the file > > This all works... except that, of course, everytime puppet runs, step a) > notice

[Puppet Users] Dynamic file content

2017-11-17 Thread Dave F
Hi I'm pretty new to puppet and am still learning, so apologies for what is probably a daft question.. I'm using puppet to deploy tomcat, and as part of this I need to dynamically edit an XML file based on data passed to the class from heira. I'm doing this by a) using a file resource to put

[Puppet Users] Dynamic file content?

2017-11-17 Thread Dave F
Hi, I'm fairly new to puppet and am working my way through various approaches to problems - probably doing them in all the worst possible ways... One thing I'm currently trying to do is configure an application using heira and puppet. The application comes with a selection of default template