Re: [Puppet Users] puppet exec to test if pattern exist in file

2016-06-30 Thread Andrew Morgan
Thank you , my solution works, but will use yours as it is best practice. On Thursday, 30 June 2016 06:49:09 UTC-4, Martin Alfke wrote: > > Hi Alonso, > > On 29 Jun 2016, at 19:06, Andrew Morgan > > wrote: > > > Thank you very much for your prompt reply... > > > > Will this work?? > > > > c

Re: [Puppet Users] puppet exec to test if pattern exist in file

2016-06-30 Thread Martin Alfke
Hi Alonso, On 29 Jun 2016, at 19:06, Andrew Morgan wrote: > Thank you very much for your prompt reply... > > Will this work?? > > class environment { > > exec{'oe_run': > path=>'/usr/bin', > command => 'echo PATH=\$PATH:/opt/logstash/bin >> > /etc/pr

Re: [Puppet Users] puppet exec to test if pattern exist in file

2016-06-29 Thread Andrew Morgan
Thank you very much for your prompt reply... Will this work?? class environment { exec{'oe_run': path=>'/usr/bin', command => 'echo PATH=\$PATH:/opt/logstash/bin >> /etc/profile', unless => "grep -qFx 'PATH=\$PATH:/opt/logstash/bin' /

Re: [Puppet Users] puppet exec to test if pattern exist in file

2016-06-29 Thread Peter Kristolaitis
First of all, I will say that this is probably a sledgehammer approach to accomplishing your goal. Many modern platforms have, in their default /etc/profile, support for /etc/profile.d/ that works like a run-parts for building the environment. The Puppet Agent package installs its own $PATH e

[Puppet Users] puppet exec to test if pattern exist in file

2016-06-29 Thread Andrew Morgan
I want to check if pattern exist in a file and then if it doesn;t echo the pattern in the file. class environment { exec{'one_run': path=>'/usr/bin', command => "echo 'PATH=$PATH:/opt/logstash/bin' >> /etc/profile", onlyif => "grep -qFx