GithubHelp home page GithubHelp logo

puppet-specifications's Issues

Regexp[pattern] semantic issue

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).

document that all class and definition parameters are available as local variables (including meta parameters)

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

Clarification on resource api's :is key

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!

clarify PATH expectations tasks should have

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:

https://github.com/puppetlabs/puppetlabs-apache/blob/e587f2af793111adab04bb776808f99a09ca092b/tasks/init.rb#L8

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:

https://github.com/puppetlabs/puppetlabs-facter_task/blob/32658a05a6080c35505267184b9a14a1ef6d8768/tasks/init.rb#L21

Define Type Algebra

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.

Could not evaluate: undefined method `strip!'

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.