Hi Marco,
On Mon, Apr 16, 2012 at 7:22 AM, Marco Parra D. <[email protected]>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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.