[Puppet Users] Re: Module layout

2016-02-13 Thread Matthew Ceroni
Follow up to this regarding variable scope.

Example:

class test1 {

  $var1 = "some value"

  include test1::child

}

class test1::child {

  notify { "$test1::var1": }

  file { "/tmp/test":
content => template("test1/test.erb")
  }
}

In this setup, in order to reference var1 I have to use the full namespace 
($test1::var1) as it isn't in the scope within the child class. However, 
within the template I can simply reference it via @var1 without having to 
supply the scope. For templates I was under impression that variables in 
local scope (calling class), node and top scope were only available..

Thanks

On Thursday, February 11, 2016 at 8:11:31 PM UTC-8, Matthew Ceroni wrote:
>
> Just a quick question (whether it really matters or not) about module 
> design.
>
> The following document
>
> https://docs.puppetlabs.com/guides/module_guides/bgtm.html
>
> Seems to indicate that the sub classes, such as install and service, 
> should inherit the main class so that they have access to the parameters 
> passed into the main class. The main class then simply includes the sub 
> classes install, service, etc.
>
> However in checking module in forge, and how I have recently been doing 
> it, the sub classes such as install and service are parameterized as well 
> and the main class simply calls them and passes the parameters pertinent to 
> that class. As an example:
>
> class apache ($package_ensure, $service_ensure) {
>
>class {  'apache::install':
>  ensure => $package_ensure
>}
>
>class { 'apache::service':
>  ensure => $service_ensure
>}
> }
>
> The classes apache::install and service don't inherit the main apache 
> class (most best practices seem to indicate not to do inheritance outside 
> of the params pattern). 
>
> So my question is, what is the best way to do it? Or is it more a matter 
> of preference? 
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/024629db-e6bf-4510-a25a-3ce4f99f0dcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] firewall module to accept array of sources/dests

2016-02-13 Thread Felix Frank

On 02/13/2016 05:34 AM, Alex Harvey wrote:


The problem is that removing sources from the array of your
multiplexer resource will just lead to some firewall resources not
being in the catalog anymore. Their respective rules will remain
orphaned, which is not what the user will expect.


Is this really a problem though?  The documentation for the module 
recommends that users do purge the unmanaged firewall rules.  If they 
choose not to, then they should understand that means they need to 
take care of those manually.  It's no different to any other resource 
in Puppet.  If one day I stop managing the /etc/motd file, I should 
understand that Puppet won't delete the file; it'll simply leave it in 
whatever state it was in.


Sure, but I feel that this case is especially confusing.

The user does not remove a resource from their manifest. They change a 
parameter of one of their resources, which feels like changing a 
property value for a proper resource. The fact that this may not be 
sync'ed correctly by the agent can be surprising, and removing firewall 
rules is a highly critical operation.


So, yes, I think you should go ahead and build that module, but please 
make sure to plaster its documentation with warnings ;-)


Cheers,
Felix

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/56BF2FE8.3040109%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet/Puppetboard throwing error 'Internal Server Error'

2016-02-13 Thread Manoj Kumar
Yes I was able to connect to that port :(

Thanks and Regards,
Manoj Kumar
FB : http://www.facebook.com/manojksamtani
Blogger: http://linuxtroubleshoot.blogspot.com/

On Sat, Feb 13, 2016 at 4:29 AM, Felix Frank <
felix.fr...@alumni.tu-berlin.de> wrote:

> OK, but seriously, what's it saying?
>
> Also, can you connect to localhost:8080 with netcat? With curl?
>
> Cheers,
> Felix
>
> On 02/12/2016 08:56 AM, Manoj Kumar wrote:
>
>> yess I can see that too
>>
>> Thanks and Regards,
>> Manoj Kumar
>>
>> OK, next debugging step: What's the output of `ss -tlnp | grep :8080` ?
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/DQsVyddNc3w/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/56BE63E7.3020308%40Alumni.TU-Berlin.de
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CADxN2ck3C3yjFU8siWB_7CnRH1o-Kf-xjp9%3DgQV%3DRtheUyBLAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.