On Nov 24, 5:32 am, Arnau Bria <arnaub...@pic.es> wrote:
[...]
> I tried the example 
> fromhttp://docs.puppetlabs.com/references/stable/type.html#filelike
>
> $srt="search mydomain.com \nnameserver 192.168.1.1 \
> \nnameserver192.168.1.2"
>
> file {
>    'default_ntp':
>          name    => '/etc/ntp.conf',
>          content => $srt#
>
> } }
>
> *notice double "{" at the end, as the exmaple shows, alo tried with simple 
> "}" with "," and ";" after $srt
>
> All my combinations produce and error. Double } syntax one (is doc wrong?) 
> and others same as above...
>
> So, how may I specify file content?

The second } at the end of that resource declaration is wrong.  A }
would appear in that location only if it was closing a surrounding
class, definition, or logic block.

I'm not sure you would need to do so, but you could try enclosing $src
in quotation marks, like so: "$src".  The property binding may
optionally be followed by a comma (,) or, because it's the last
property declared for the resource, by a semicolon (;).  Thus, I might
write this:

file { "/etc/ntp.conf":
    content => "$src"
}

or this:

file { "/etc/ntp.conf":
    content => "$src",
}

or this:

file { "/etc/ntp.conf":
    content => "$src";
}


Also, I do recommend declaring the owner, group, and mode for the
file.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to