FAQ
Hi,

I have a parametrised class to manage /etc/security/access.conf that
accepts an "entries" parameter.
I've included this class in a generic node definition:

node common-node {
class{'pam_access':
entries => ["+ : ALL : ALL"],
}
}

My real nodes inherit this node definition:

node 'test01' inherits common-node {
}

How can I override this class parameter in the test01 node? I've tried
setting

Class['pam_access'] {
entries => ["- : idiot : ALL" ],
}

But it doesn't seem to have any effect. The initial settings remain active
and no error is logged.

How can I do this type of change with parametrised classes?

Regards,

Rik



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

Search Discussions

  • Martin Alfke at Jul 18, 2012 at 3:59 pm
    Hi,

    I assume that this is related to node inheritance and variable scoping:

    http://docs.puppetlabs.com/guides/troubleshooting.html#node-inheritance-and-variable-scope

    - Martin
    On 18.07.2012, at 15:32, Rik Theys wrote:

    Hi,

    I have a parametrised class to manage /etc/security/access.conf that accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik




    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Ju3_jRhGh78J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fred Gansevles at Jul 20, 2012 at 11:00 am
    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/W3UucsSZ49oJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fred Gansevles at Jul 20, 2012 at 11:00 am
    Hi,

    I ran into the same problem, i.e. overriding a class parameter with
    (apparently) no effect
    After some digging, I found that there was an effect, the change was
    reflected in the compiled catalog
    but somehow the Puppet::Parser::Scope::lookupvar method ignored this

    I made a patch for puppet/parser/scope.rb (against puppet-2.7.16) that
    makes lookupvar look in the right place

    I don't know what effect this patch has on other parts of puppet, and if
    other people (puppetlabs?) are interested in this patch,
    but in my case everything kept working

    Fred.


    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DvI_vuf2fjEJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Felix Frank at Jul 20, 2012 at 11:59 am

    On 07/20/2012 12:48 PM, Fred Gansevles wrote:
    Hi,

    I ran into the same problem, i.e. overriding a class parameter with
    (apparently) no effect
    After some digging, I found that there was an effect, the change was
    reflected in the compiled catalog
    but somehow the Puppet::Parser::Scope::lookupvar method ignored this

    I made a patch for puppet/parser/scope.rb (against puppet-2.7.16) that
    makes lookupvar look in the right place

    I don't know what effect this patch has on other parts of puppet, and if
    other people (puppetlabs?) are interested in this patch,
    but in my case everything kept working

    Fred.
    Fascinating!

    From all I had gathered since class parameters are available, overriding
    them was not at all possible. It will be interesting to hear a
    developer's comments on your approach.

    I believe there are possible problems, but knowing there's a fix for the
    bigger problem is great.

    Thanks for sharing.

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Polaris_s0i at Dec 14, 2012 at 6:07 pm
    Do you know if this was ever fixed in a later version of puppet?
    If not, is there a bug filed with puppetlabs for this?
    On Friday, July 20, 2012 7:59:23 AM UTC-4, Felix.Frank wrote:
    On 07/20/2012 12:48 PM, Fred Gansevles wrote:
    Hi,

    I ran into the same problem, i.e. overriding a class parameter with
    (apparently) no effect
    After some digging, I found that there was an effect, the change was
    reflected in the compiled catalog
    but somehow the Puppet::Parser::Scope::lookupvar method ignored this

    I made a patch for puppet/parser/scope.rb (against puppet-2.7.16) that
    makes lookupvar look in the right place

    I don't know what effect this patch has on other parts of puppet, and if
    other people (puppetlabs?) are interested in this patch,
    but in my case everything kept working

    Fred.
    Fascinating!

    From all I had gathered since class parameters are available, overriding
    them was not at all possible. It will be interesting to hear a
    developer's comments on your approach.

    I believe there are possible problems, but knowing there's a fix for the
    bigger problem is great.

    Thanks for sharing.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/hXI517RU0U0J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fred Gansevles at Jul 20, 2012 at 11:38 am
    Hi,

    I had the same problem, i.e. overriding parameters with (seemingly) no
    effect

    After some digging, I found that the parameters *are* set, since the
    changes are reflected in the compiled catalog
    but the Puppet::Parser::Scope::lookupvar method *didn't look in the right
    place*.

    I've made a patch that makes lookupvar take resource parameters into account

    In my case, everything else kept working but I don't know if this patch
    affects other pars of puppet

    Maybe others are also interested in this patch (puppetlabs?)

    It is against puppet-2.7.16 and patches puppet/parser/scope.rb

    Fred.

    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik



    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik



    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik



    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik



    Op woensdag 18 juli 2012 15:32:10 UTC+2 schreef Rik Theys het volgende:
    Hi,

    I have a parametrised class to manage /etc/security/access.conf that
    accepts an "entries" parameter.
    I've included this class in a generic node definition:

    node common-node {
    class{'pam_access':
    entries => ["+ : ALL : ALL"],
    }
    }

    My real nodes inherit this node definition:

    node 'test01' inherits common-node {
    }

    How can I override this class parameter in the test01 node? I've tried
    setting

    Class['pam_access'] {
    entries => ["- : idiot : ALL" ],
    }

    But it doesn't seem to have any effect. The initial settings remain active
    and no error is logged.

    How can I do this type of change with parametrised classes?

    Regards,

    Rik


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 18, '12 at 2:08p
activeDec 14, '12 at 6:07p
posts7
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase