Hi guys, I trying to modify a file on Windows using puppet, I got a template file like this: [default] host = SOmeNAme [WinEventLog:Security] disabled = 1 is copied using puppet to the windows machine as C:\Program Files\Soft1\inputs.conf And I need to replace the host line with the real name of the windows machine: i.e.: host = machine1 Is this possible using puppet for windows? Regards. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Marco, On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. <marco.parra.d@gmail.com>wrote:> Hi guys, I trying to modify a file on Windows using puppet, I got a > template file like this: > [default] > host = SOmeNAme > > [WinEventLog:Security] > disabled = 1 > > is copied using puppet to the windows machine as C:\Program > Files\Soft1\inputs.conf > > And I need to replace the host line with the real name of the windows > machine: > > i.e.: host = machine1 > > Is this possible using puppet for windows? > > Regards.Yes, definitely. You should be able to specify the file content parameter as a template: file { ''C:\Program Files\Soft1\inputs.conf'': ensure => present, content => template(''module/template.erb'') } and then in your template template.erb, you can have it resolve the value of the host property using the agent''s hostname fact: host = <%= @hostname %> This page provides more information about puppet templates: http://docs.puppetlabs.com/guides/templating.html Josh -- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 16-04-2012 12:55, Josh Cooper wrote:> Hi Marco, > > On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. > <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: > > Hi guys, I trying to modify a file on Windows using puppet, I got > a template file like this: > [default] > host = SOmeNAme > > [WinEventLog:Security] > disabled = 1 > > is copied using puppet to the windows machine as C:\Program > Files\Soft1\inputs.conf > > And I need to replace the host line with the real name of the > windows machine: > > i.e.: host = machine1 > > Is this possible using puppet for windows? > > Regards. > > > Yes, definitely. You should be able to specify the file content > parameter as a template: > > file { ''C:\Program Files\Soft1\inputs.conf'': > ensure => present, > content => template(''module/template.erb'') > } > > and then in your template template.erb, you can have it resolve the > value of the host property using the agent''s hostname fact: > > host = <%= @hostname %> > > This page provides more information about puppet templates: > http://docs.puppetlabs.com/guides/templating.html > > Josh > > -- > Josh Cooper > Developer, Puppet Labs > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.Hi Josh, I''ll try this, thanks a lot... Regards.. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Josh.... On 16-04-2012 12:55, Josh Cooper wrote:> Hi Marco, > > On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. > <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: > > Hi guys, I trying to modify a file on Windows using puppet, I got > a template file like this: > [default] > host = SOmeNAme > > [WinEventLog:Security] > disabled = 1 > > is copied using puppet to the windows machine as C:\Program > Files\Soft1\inputs.conf > > And I need to replace the host line with the real name of the > windows machine: > > i.e.: host = machine1 > > Is this possible using puppet for windows? > > Regards. > > > Yes, definitely. You should be able to specify the file content > parameter as a template: > > file { ''C:\Program Files\Soft1\inputs.conf'': > ensure => present, > content => template(''module/template.erb'') > } > > and then in your template template.erb, you can have it resolve the > value of the host property using the agent''s hostname fact: > > host = <%= @hostname %> > > This page provides more information about puppet templates: > http://docs.puppetlabs.com/guides/templating.html > > Josh > > -- > Josh Cooper > Developer, Puppet Labs > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.It works perfect, thank you again! :) Regards.! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Josh, Where can I find the complete fact''s list to use on windows?... thank you in advance! Regards.. On 16-04-2012 12:55, Josh Cooper wrote:> Hi Marco, > > On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. > <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: > > Hi guys, I trying to modify a file on Windows using puppet, I got > a template file like this: > [default] > host = SOmeNAme > > [WinEventLog:Security] > disabled = 1 > > is copied using puppet to the windows machine as C:\Program > Files\Soft1\inputs.conf > > And I need to replace the host line with the real name of the > windows machine: > > i.e.: host = machine1 > > Is this possible using puppet for windows? > > Regards. > > > Yes, definitely. You should be able to specify the file content > parameter as a template: > > file { ''C:\Program Files\Soft1\inputs.conf'': > ensure => present, > content => template(''module/template.erb'') > } > > and then in your template template.erb, you can have it resolve the > value of the host property using the agent''s hostname fact: > > host = <%= @hostname %> > > This page provides more information about puppet templates: > http://docs.puppetlabs.com/guides/templating.html > > Josh > > -- > Josh Cooper > Developer, Puppet Labs > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mon, Apr 16, 2012 at 1:30 PM, Marco Parra D. <marco.parra.d@gmail.com>wrote:> Hi Josh, > Where can I find the complete fact''s list to use on windows?... > > thank you in advance! > > Regards.. >You should be able to run Facter directly on the system in question.> > On 16-04-2012 12:55, Josh Cooper wrote: > > Hi Marco, > > On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. <marco.parra.d@gmail.com>wrote: > >> Hi guys, I trying to modify a file on Windows using puppet, I got a >> template file like this: >> [default] >> host = SOmeNAme >> >> [WinEventLog:Security] >> disabled = 1 >> >> is copied using puppet to the windows machine as C:\Program >> Files\Soft1\inputs.conf >> >> And I need to replace the host line with the real name of the windows >> machine: >> >> i.e.: host = machine1 >> >> Is this possible using puppet for windows? >> >> Regards. > > > Yes, definitely. You should be able to specify the file content > parameter as a template: > > file { ''C:\Program Files\Soft1\inputs.conf'': > ensure => present, > content => template(''module/template.erb'') > } > > and then in your template template.erb, you can have it resolve the > value of the host property using the agent''s hostname fact: > > host = <%= @hostname %> > > This page provides more information about puppet templates: > http://docs.puppetlabs.com/guides/templating.html > > Josh > > -- > Josh Cooper > Developer, Puppet Labs > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- Kelsey Hightower Solutions Engineer Puppet Labs 1-678-471-9501 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Kelsey, thank you, Are these the only list of facts?, What makes this list?, It''s possible add more facts to windows? Thank you Regards.! On 16-04-2012 14:33, Kelsey Hightower wrote:> On Mon, Apr 16, 2012 at 1:30 PM, Marco Parra D. > <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: > > Hi Josh, > Where can I find the complete fact''s list to use on windows?... > > thank you in advance! > > Regards.. > > > You should be able to run Facter directly on the system in question. > > > On 16-04-2012 12:55, Josh Cooper wrote: >> Hi Marco, >> >> On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. >> <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: >> >> Hi guys, I trying to modify a file on Windows using puppet, >> I got a template file like this: >> [default] >> host = SOmeNAme >> >> [WinEventLog:Security] >> disabled = 1 >> >> is copied using puppet to the windows machine as C:\Program >> Files\Soft1\inputs.conf >> >> And I need to replace the host line with the real name of the >> windows machine: >> >> i.e.: host = machine1 >> >> Is this possible using puppet for windows? >> >> Regards. >> >> >> Yes, definitely. You should be able to specify the file content >> parameter as a template: >> >> file { ''C:\Program Files\Soft1\inputs.conf'': >> ensure => present, >> content => template(''module/template.erb'') >> } >> >> and then in your template template.erb, you can have it resolve >> the value of the host property using the agent''s hostname fact: >> >> host = <%= @hostname %> >> >> This page provides more information about puppet templates: >> http://docs.puppetlabs.com/guides/templating.html >> >> Josh >> >> -- >> Josh Cooper >> Developer, Puppet Labs >> >> -- >> You received this message because you are subscribed to the >> Google Groups "Puppet Users" group. >> To post to this group, send email to >> puppet-users@googlegroups.com <mailto:puppet-users@googlegroups.com>. >> To unsubscribe from this group, send email to >> puppet-users+unsubscribe@googlegroups.com >> <mailto:puppet-users+unsubscribe@googlegroups.com>. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com > <mailto:puppet-users@googlegroups.com>. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com > <mailto:puppet-users%2Bunsubscribe@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > > > -- > Kelsey Hightower > Solutions Engineer > Puppet Labs > 1-678-471-9501 > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Marco, On Mon, Apr 16, 2012 at 10:45 AM, Marco Parra D. <marco.parra.d@gmail.com>wrote:> Hi Kelsey, > thank you, Are these the only list of facts?, What makes this list?, >I don''t think we have a "facts supported by platform" sort of document. Windows does support basic facts, e.g. hostname, domain, etc. This is the ticket describing the initial set of facts we added support for in 2.7.x: http://projects.puppetlabs.com/issues/8439> It''s possible add more facts to windows? >You can always write custom facts. http://docs.puppetlabs.com/guides/custom_facts.html Josh -- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Josh On 16-04-2012 15:24, Josh Cooper wrote:> Hi Marco, > > On Mon, Apr 16, 2012 at 10:45 AM, Marco Parra D. > <marco.parra.d@gmail.com <mailto:marco.parra.d@gmail.com>> wrote: > > Hi Kelsey, > thank you, Are these the only list of facts?, What makes this list?, > > > I don''t think we have a "facts supported by platform" sort of > document. Windows does support basic facts, e.g. hostname, domain, > etc. This is the ticket describing the initial set of facts we added > support for in 2.7.x: http://projects.puppetlabs.com/issues/8439 > > It''s possible add more facts to windows? > > > You can always write custom facts. > http://docs.puppetlabs.com/guides/custom_facts.html > > Josh > > -- > Josh Cooper > Developer, Puppet Labs > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.I''ll check the page that you gave me... Thank you... Regards -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.