puppetlabs / puppet-specifications Goto Github PK
View Code? Open in Web Editor NEWSpecification of the Puppet Language, Catalog, Extension points
License: Other
Specification of the Puppet Language, Catalog, Extension points
License: Other
in erb template, when we want to call a function f()
we have to use
scope.function_f([argument1, argument2])
the equivalent of doing this in epp template is undocumented.
If an attempt is used to specify options, this will result in an error (e.g. /.*/m).
should be
If an attempt is made to specify options, this will result in an error (e.g. /.*/m).
https://www.gitbook.io/ offers a simple mechanism for publishing your "book" online
Adam Vinsh from the Puppet OpenStack module community brought up in IRC this morning that they discovered that they could use $require in the local scope of a defined type[1].
This got me wondering how local variables are generated from parameters and specifically how this intertwines with meta parameters. I was able to follow a path in the Puppet source that seemed to validate that all parameters of a resource are added to parameter scope[2] and that parameter scope will eventually make it into local scope by virtual of traveling through ephemeral scope[3]. Combine this with the specification that meta parameters are available in parameter scope[4] and it seems that you have an implicit behavior that one should expect that all meta parameters and their values are available in local scope.
[1] https://review.openstack.org/#/c/378950/10/manifests/service.pp
[2] https://github.com/puppetlabs/puppet/blob/master/lib/puppet/resource/type.rb#L347-L387
[3] https://github.com/puppetlabs/puppet/blob/master/lib/puppet/parser/scope.rb#L928
[4] https://github.com/puppetlabs/puppet-specifications/blob/master/language/parameter_scope.md#meta-parameters-are-available-in-parameter-scope
If the :is value is nil, the resources were not found by get.
Clear enough. The resource isn't there and needs to run through create
If there is no :is key, the runtime did not have a cached state available.
I'm not sure what this is supposed to mean. Does this mean it doesn't show up as a resource but that the resource might actually be there? If that's the case, I don't know what set
is supposed to do about it. Can someone please clarify? Thanks!
Callable[signature]'s explanation is super confusing not-english:
They of importance for those that write functions in Ruby and what to type check lambdas that are given as arguments to functions in Ruby.
At present there is no mention of what should and should not be in the PATH for tasks to rely on, the Apache task has this:
Here it relies on facter
being in the path which only works in PE because apparently PE links facter
to /usr/local/bin
- something puppet-agent
does not do.
It probably works under ssh bolt because that reads the profile files that may or may not exist on the node
It all kind of seems to work by accident rather than clear specification.
A quick chat on Slack about this suggested that probably tasks should not expect PATH to have anything and should use full paths for most things like here:
In the lexical structure section on comments we specify both, #
and /* … */
comments.
I note that there are no //
style comments in puppet 4.0.
The official Puppet Style Guide recommends one does _not_ use //
or /* … */
.
Perhaps they should be retired in 4.0 altogether?
Since we're defining EBNF, we should — for completeness — define the Type Algebra also. The meaning of
T ∪ T → T
may not be clear to anyone who's CS education either is incomplete, or a (couple of) decade(s) in the past.
The term QualifiedReference
is used at multiple places in the grammar, but I could not find its formal definition. Please help.
Hello,
Could you please advise what could be a reason for error: undefined method `strip!'
example class:
$test = " t1 "
$test1 = strip("$test")
$test2 = $test.strip
notice("test: ${test}")
notice("test1: ${test1}")
notice("test2: ${test2}")
augeas { "sshd_config":
context => "/files/ssh/sshd_config",
changes => [
"set /files/etc/ssh/sshd_config/PermitRootLogin yes",
onlyif => "match *[. = 'PermitRootLogin'] == 'no'",
],
}
output:
puppet apply:
Notice: Scope(Class[Inf_ldap::S]): test: t1
Notice: Scope(Class[Inf_ldap::S]): test1: t1
Notice: Scope(Class[Inf_ldap::S]): test2: t1
Notice: Compiled catalog for orcpuit14 in environment dev in 0.14 seconds
Info: Applying configuration version '1550482520'
Error: /Stage[main]/Inf_ldap::S/Augeas[sshd_config]: Could not evaluate: undefined method `strip!' for {"onlyif"=>"match *[. = 'PermitRootLogin'] == 'no'"}:Hash
Function strip works, but not for augeas.
That is default installation of puppet-agent-6.2.0-1.el7.x86_64 on RH7.
vendormoduledir = /opt/puppetlabs/puppet/vendor_modules
strip function file comes with puppet agent:
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/functions/strip.rb
--
Regards,
Hubert
Hello there,
The example in https://github.com/puppetlabs/puppet-specifications/blob/master/language/heredoc.md#splitting-and-joining-long-lines opens heredoc as @(END:L)
. I wonder if it should have been @(END/L)
for escaping newlines, not syntax checking for ‘L’ language?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.