FAQ
I am trying to add a property to the User type in order to be able to
turn off the screen saver of the managed users. Everything I have found
on custom types has been around creating an entirely new type rather
than extending an existing one -- except for one sentence on the Custom
Types page; 'You can optionally specify a parent class; otherwise,
Puppet::Type is used as the parent class.'

With that in mind, in theory, something like this should work

Puppet::Type.newtype(:extended_windows_user, {:parent =>
Puppet::Type::User}) do
newproperty(:screensaver_enabled) do
desc "boilerplate"
end
end

but when I run the agent the manifest cannot be compiled saying

Invalid parameter managehome at ...

which I would have expected it to find since it is in the :parent. And
does work if I use 'user' rather than 'extended_windows_user' in my
manifest.

Is there some missing bit of inheritance magic I am missing? I've been
staring at this now for long enough that even if the solution was right
in front of me I would mess it.

Thanks.

-adam

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

Search Discussions

  • Ken Barber at Jan 9, 2013 at 11:32 pm

    I am trying to add a property to the User type in order to be able to turn
    off the screen saver of the managed users. Everything I have found on custom
    types has been around creating an entirely new type rather than extending an
    existing one -- except for one sentence on the Custom Types page; 'You can
    optionally specify a parent class; otherwise, Puppet::Type is used as the
    parent class.'
    I don't think you can add new properties or parameters to an existing
    type. Not easily anyway.

    What I would recommend, is creating a defined type/resource instead
    that creates users - and add your functionality into that. You then
    have a nice wrapper that you can customize. More or less defined types
    work like ruby types anyway, and avoid a lot of code hassles that are
    probably not required in your case:

    http://docs.puppetlabs.com/learning/definedtypes.html

    ... unless you have a reason for needing a proper Ruby type?

    ken.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 30, '12 at 5:08a
activeJan 9, '13 at 11:32p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Ken Barber: 1 post Adam Goucher: 1 post

People

Translate

site design / logo © 2022 Grokbase