On 2013-26-08 1:07, Erik Dalén wrote:
On 25 August 2013 15:47, Henrik Lindberg <[email protected]
<mailto:[email protected]>> wrote:
I'm asking, what language do I use between <% %>? Can I write
<%
file {
'/etc/motd':
content => "hello, world\n"
}
%>
At the technical parsing level, yes. This is then validated to only
include what we want to allow. The first implementation is very
permissive.
which is what "Embedded Puppet" suggests to me. That's not the
case,
and "Puppet DSL" is only slightly less unclear, unless the reader is
enough of a Rubyist to realize that "DSL" in the Ruby community
refers
to a modified Ruby environment, and not an entirely different
language. Basically, please add a link so I know unambiguously
what I
can and cannot do between <% .. %>.
All Puppet DSL expressions that do not require "top level" (i.e.
class and define) can be used.
They don't require top level in puppet manifests, this should be legal:
class foo {
class bar {
...
}
}
I am using imprecise language, sorry.
The statements 'node', 'class xxx{}, and 'define xxx {}' are not allowed
in "conditional logic" which is the same as "nested block expression"
which is in fact an EPP is evaluated in.
just that it declares the classes foo and foo::bar, not foo and bar.
Is this somehow disallowed in epp?
Do you want to define classes and user defined types as a side effect
while producing template text? That seems odd.
The statement I made is only about Puppet DSL logic inside a template.
node statements requires top level though afaik.
yes.
in puppet version 2.6.8+ anonymous arrays and hashes should be allowed,
so that worked in recent versions of the old parser as well.
oh, I was not aware of that. Have to check then. I started looking at
the grammar around mid 2.7.x, and when I compared what worked and what
did not against fairly recent versions on 2.7, and then for all 3.x
versions. Anyway, needs to be checked so not spreading false information
about problems that are non-existing.
Thanks for pointing it out.
- henrik
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.