FAQ
So I was looking at the type reference, and noticed that for a lot of the
types, no namevar was listed. When I checked the types in the code, for
each of those omissions, the namevar was simply "name". Now, it might be
self evident that this is the case, but a little documentation couldn't
hurt, If not in each type, at least in the section where it describes what
namevars are. Something like: "If namevar is not specified, assumed that it
is 'name'".

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

  • Gary Larizza at Dec 5, 2012 at 8:44 pm
    Hi Ellison,

    You can do `puppet decribe <type>` from the command line and it should tell
    you which attribute is the namevar for that type. Most types use 'name'
    for their namevar, but some (like file) do not. Hope that helps!

    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks wrote:

    So I was looking at the type reference, and noticed that for a lot of the
    types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".

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


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs

    --
    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.
  • Ellison Marks at Dec 5, 2012 at 8:49 pm
    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/references/latest/type.html
    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,

    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!


    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks <gty...@gmail.com<javascript:>
    wrote:
    So I was looking at the type reference, and noticed that for a lot of the
    types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".

    --
    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/-/xtGOPopeEHoJ.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs
    --
    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/-/SdYgGWyMuzsJ.
    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.
  • Dan White at Dec 5, 2012 at 8:55 pm
    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance. This is the parameter that gets assigned when a string is provided before the colon in a type declaration. In general, only developers will need to worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gtyaoi@gmail.com>
    To: puppet-users@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as accurate as ever, it would be nice to find that info on the type page as well.

    http://docs.puppetlabs.com/references/latest/type.html

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should tell you which attribute is the namevar for that type. Most types use 'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks wrote:


    So I was looking at the type reference, and noticed that for a lot of the types, no namevar was listed. When I checked the types in the code, for each of those omissions, the namevar was simply "name". Now, it might be self evident that this is the case, but a little documentation couldn't hurt, If not in each type, at least in the section where it describes what namevars are. Something like: "If namevar is not specified, assumed that it is 'name'".


    --
    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/-/xtGOPopeEHoJ .
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to puppet-users...@googlegroups.com .
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en .




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/-/SdYgGWyMuzsJ .
    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.
  • Ellison Marks at Dec 5, 2012 at 9:01 pm
    I read that bit. It doesn't identify a default namevar, nor indicate that
    the "name" parameter is special. Again, maybe it's common sense, but having
    it spelled out explicitly can't be a bad thing. Also, I dispute that
    namevars are only important to developers (assuming by developer they mean
    someone writing a new puppet type). I can use them to save typing when
    writing a manifest.
    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance.
    This is the parameter that gets assigned when a string is provided before
    the colon in a type declaration. In general, only developers will need to
    worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists elsewhere
    in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gty...@gmail.com <javascript:>>
    To: puppet...@googlegroups.com <javascript:>
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/references/latest/type.html

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks < gty...@gmail.com >
    wrote:


    So I was looking at the type reference, and noticed that for a lot of the
    types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".


    --
    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/-/xtGOPopeEHoJ .
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com .
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en .




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/-/SdYgGWyMuzsJ .
    To post to this group, send email to puppet...@googlegroups.com<javascript:>.

    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    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 view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/NAIg8EIroOsJ.
    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.
  • Gary Larizza at Dec 5, 2012 at 9:08 pm

    On Wed, Dec 5, 2012 at 1:01 PM, Ellison Marks wrote:

    I read that bit. It doesn't identify a default namevar, nor indicate that
    the "name" parameter is special. Again, maybe it's common sense, but having
    it spelled out explicitly can't be a bad thing. Also, I dispute that
    namevars are only important to developers (assuming by developer they mean
    someone writing a new puppet type). I can use them to save typing when
    writing a manifest.

    Check the type reference again - I'm seeing the Namevar in bold next to the
    attribute that is the namevar (
    http://docs.puppetlabs.com/references/latest/type.html#exec). Are you
    seeing something different?

    The latter part I would caution against. Consider the situation where you
    use the namevar in an exec for its 'command' attribute:

    exec { '/bin/somecommand -f -a':
    refreshonly => true,
    }

    file {'/var/tmp/foo':
    notify => Exec['/bin/somecommand -f -a'],
    }

    If, in the future, you realize that you need to change the exec resource,
    now you have to change everything that REFERENCES IT too (since references
    use the title). I hit this pretty late in the game in my old job, and it
    became a bit tedious.


    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance.
    This is the parameter that gets assigned when a string is provided before
    the colon in a type declaration. In general, only developers will need to
    worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists elsewhere
    in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gty...@gmail.com>
    To: puppet...@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/**references/latest/type.html<http://docs.puppetlabs.com/references/latest/type.html>

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks < gty...@gmail.com >
    wrote:


    So I was looking at the type reference, and noticed that for a lot of the
    types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".


    --
    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/-/**xtGOPopeEHoJ<https://groups.google.com/d/msg/puppet-users/-/xtGOPopeEHoJ>.
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.**com .
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>.




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/-/**SdYgGWyMuzsJ<https://groups.google.com/d/msg/puppet-users/-/SdYgGWyMuzsJ>.
    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.com.
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<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 view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/NAIg8EIroOsJ.

    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.


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs

    --
    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.
  • Ellison Marks at Dec 5, 2012 at 9:14 pm
    Ah, point taken about using namevars.

    As to the documentation, it lists the namevar, but only where it differs
    from "name". There are a bunch of types, cron and user to name two, whose
    namevar is the "name" parameter, but there's no indication in the doc that
    this is the case. In fact, for these types, there's no indication that they
    have any namevar at all.
    On Wednesday, December 5, 2012 1:08:27 PM UTC-8, Gary Larizza wrote:




    On Wed, Dec 5, 2012 at 1:01 PM, Ellison Marks <gty...@gmail.com<javascript:>
    wrote:
    I read that bit. It doesn't identify a default namevar, nor indicate that
    the "name" parameter is special. Again, maybe it's common sense, but having
    it spelled out explicitly can't be a bad thing. Also, I dispute that
    namevars are only important to developers (assuming by developer they mean
    someone writing a new puppet type). I can use them to save typing when
    writing a manifest.

    Check the type reference again - I'm seeing the Namevar in bold next to
    the attribute that is the namevar (
    http://docs.puppetlabs.com/references/latest/type.html#exec). Are you
    seeing something different?

    The latter part I would caution against. Consider the situation where you
    use the namevar in an exec for its 'command' attribute:

    exec { '/bin/somecommand -f -a':
    refreshonly => true,
    }

    file {'/var/tmp/foo':
    notify => Exec['/bin/somecommand -f -a'],
    }

    If, in the future, you realize that you need to change the exec resource,
    now you have to change everything that REFERENCES IT too (since references
    use the title). I hit this pretty late in the game in my old job, and it
    became a bit tedious.


    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance.
    This is the parameter that gets assigned when a string is provided before
    the colon in a type declaration. In general, only developers will need to
    worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists
    elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gty...@gmail.com>
    To: puppet...@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/**references/latest/type.html<http://docs.puppetlabs.com/references/latest/type.html>

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks < gty...@gmail.com >
    wrote:


    So I was looking at the type reference, and noticed that for a lot of
    the types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".


    --
    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/-/**xtGOPopeEHoJ<https://groups.google.com/d/msg/puppet-users/-/xtGOPopeEHoJ>.
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.**com .
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>.




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/-/**SdYgGWyMuzsJ<https://groups.google.com/d/msg/puppet-users/-/SdYgGWyMuzsJ>.
    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.com.
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<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 view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/NAIg8EIroOsJ.

    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs
    --
    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/-/kS5QTo0A7noJ.
    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.
  • Gary Larizza at Dec 5, 2012 at 9:15 pm
    Gotcha,

    That would probably be a good ticket for our docs project in Redmine -->
    http://projects.puppetlabs.com/projects/puppet-docs

    On Wed, Dec 5, 2012 at 1:14 PM, Ellison Marks wrote:

    Ah, point taken about using namevars.

    As to the documentation, it lists the namevar, but only where it differs
    from "name". There are a bunch of types, cron and user to name two, whose
    namevar is the "name" parameter, but there's no indication in the doc that
    this is the case. In fact, for these types, there's no indication that they
    have any namevar at all.
    On Wednesday, December 5, 2012 1:08:27 PM UTC-8, Gary Larizza wrote:



    On Wed, Dec 5, 2012 at 1:01 PM, Ellison Marks wrote:

    I read that bit. It doesn't identify a default namevar, nor indicate
    that the "name" parameter is special. Again, maybe it's common sense, but
    having it spelled out explicitly can't be a bad thing. Also, I dispute that
    namevars are only important to developers (assuming by developer they mean
    someone writing a new puppet type). I can use them to save typing when
    writing a manifest.

    Check the type reference again - I'm seeing the Namevar in bold next to
    the attribute that is the namevar (http://docs.puppetlabs.com/**
    references/latest/type.html#**exec<http://docs.puppetlabs.com/references/latest/type.html#exec>).
    Are you seeing something different?

    The latter part I would caution against. Consider the situation where
    you use the namevar in an exec for its 'command' attribute:

    exec { '/bin/somecommand -f -a':
    refreshonly => true,
    }

    file {'/var/tmp/foo':
    notify => Exec['/bin/somecommand -f -a'],
    }

    If, in the future, you realize that you need to change the exec resource,
    now you have to change everything that REFERENCES IT too (since references
    use the title). I hit this pretty late in the game in my old job, and it
    became a bit tedious.


    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance.
    This is the parameter that gets assigned when a string is provided before
    the colon in a type declaration. In general, only developers will need to
    worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists
    elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gty...@gmail.com>
    To: puppet...@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/**ref**erences/latest/type.html<http://docs.puppetlabs.com/references/latest/type.html>

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks < gty...@gmail.com >
    wrote:


    So I was looking at the type reference, and noticed that for a lot of
    the types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".


    --
    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/**
    ms**g/puppet-users/-/**xtGOPopeEHoJ<https://groups.google.com/d/msg/puppet-users/-/xtGOPopeEHoJ>.
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.**c**om .
    For more options, visit this group at http://groups.google.com/**group*
    */puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>.




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/**
    ms**g/puppet-users/-/**SdYgGWyMuzsJ<https://groups.google.com/d/msg/puppet-users/-/SdYgGWyMuzsJ>.
    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.**com.
    For more options, visit this group at http://groups.google.com/**group*
    */puppet-users?hl=en<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 view this discussion on the web visit https://groups.google.com/d/**
    msg/puppet-users/-/**NAIg8EIroOsJ<https://groups.google.com/d/msg/puppet-users/-/NAIg8EIroOsJ>
    .

    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.com.
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>
    .


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs
    --
    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/-/kS5QTo0A7noJ.

    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.


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs

    --
    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.
  • Dan White at Dec 5, 2012 at 9:27 pm
    Help me out here, please.
    I believe I understand the descriptions given by both sides.
    What I do not understand is "why is it a concern ?"
    How do you plan to use "namevar" that makes this clarification important to you ?

    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Gary Larizza" <gary@puppetlabs.com>
    To: puppet-users@googlegroups.com
    Sent: Wednesday, December 5, 2012 4:15:17 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Gotcha,

    That would probably be a good ticket for our docs project in Redmine --> http://projects.puppetlabs.com/projects/puppet-docs

    On Wed, Dec 5, 2012 at 1:14 PM, Ellison Marks wrote:

    Ah, point taken about using namevars.

    As to the documentation, it lists the namevar, but only where it differs from "name". There are a bunch of types, cron and user to name two, whose namevar is the "name" parameter, but there's no indication in the doc that this is the case. In fact, for these types, there's no indication that they have any namevar at all.

    On Wednesday, December 5, 2012 1:08:27 PM UTC-8, Gary Larizza wrote:

    On Wed, Dec 5, 2012 at 1:01 PM, Ellison Marks wrote:

    I read that bit. It doesn't identify a default namevar, nor indicate that the "name" parameter is special. Again, maybe it's common sense, but having it spelled out explicitly can't be a bad thing. Also, I dispute that namevars are only important to developers (assuming by developer they mean someone writing a new puppet type). I can use them to save typing when writing a manifest.

    Check the type reference again - I'm seeing the Namevar in bold next to the attribute that is the namevar ( http://docs.puppetlabs.com/ references/latest/type.html# exec ). Are you seeing something different?

    The latter part I would caution against. Consider the situation where you use the namevar in an exec for its 'command' attribute:

    exec { '/bin/somecommand -f -a':
    refreshonly => true,
    }

    file {'/var/tmp/foo':
    notify => Exec['/bin/somecommand -f -a'],
    }

    If, in the future, you realize that you need to change the exec resource, now you have to change everything that REFERENCES IT too (since references use the title). I hit this pretty late in the game in my old job, and it became a bit tedious.

    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type instance. This is the parameter that gets assigned when a string is provided before the colon in a type declaration. In general, only developers will need to worry about which parameter is the namevar.

    ----- Original Message -----

    From: "Ellison Marks" < gty...@gmail.com >
    To: puppet...@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as accurate as ever, it would be nice to find that info on the type page as well.

    http://docs.puppetlabs.com/ ref erences/latest/type.html

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,

    You can do `puppet decribe <type>` from the command line and it should tell you which attribute is the namevar for that type. Most types use 'name' for their namevar, but some (like file) do not. Hope that helps!

    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks wrote:

    So I was looking at the type reference, and noticed that for a lot of the types, no namevar was listed. When I checked the types in the code, for each of those omissions, the namevar was simply "name". Now, it might be self evident that this is the case, but a little documentation couldn't hurt, If not in each type, at least in the section where it describes what namevars are. Something like: "If namevar is not specified, assumed that it is 'name'".

    --
    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.
  • Ellison Marks at Dec 5, 2012 at 9:38 pm
    Thanks for the advice. Ticket filed.

    As to why is this a concern, I don't know yet what I might use namevar for
    (not writing manifests, as I've just been told :P), but if or when that
    time comes, I want to be able to find out what the namevars are by looking
    at the documentation.
    On Wednesday, December 5, 2012 1:15:17 PM UTC-8, Gary Larizza wrote:

    Gotcha,

    That would probably be a good ticket for our docs project in Redmine -->
    http://projects.puppetlabs.com/projects/puppet-docs


    On Wed, Dec 5, 2012 at 1:14 PM, Ellison Marks <gty...@gmail.com<javascript:>
    wrote:
    Ah, point taken about using namevars.

    As to the documentation, it lists the namevar, but only where it differs
    from "name". There are a bunch of types, cron and user to name two, whose
    namevar is the "name" parameter, but there's no indication in the doc that
    this is the case. In fact, for these types, there's no indication that they
    have any namevar at all.
    On Wednesday, December 5, 2012 1:08:27 PM UTC-8, Gary Larizza wrote:



    On Wed, Dec 5, 2012 at 1:01 PM, Ellison Marks wrote:

    I read that bit. It doesn't identify a default namevar, nor indicate
    that the "name" parameter is special. Again, maybe it's common sense, but
    having it spelled out explicitly can't be a bad thing. Also, I dispute that
    namevars are only important to developers (assuming by developer they mean
    someone writing a new puppet type). I can use them to save typing when
    writing a manifest.

    Check the type reference again - I'm seeing the Namevar in bold next to
    the attribute that is the namevar (http://docs.puppetlabs.com/**
    references/latest/type.html#**exec<http://docs.puppetlabs.com/references/latest/type.html#exec>).
    Are you seeing something different?

    The latter part I would caution against. Consider the situation where
    you use the namevar in an exec for its 'command' attribute:

    exec { '/bin/somecommand -f -a':
    refreshonly => true,
    }

    file {'/var/tmp/foo':
    notify => Exec['/bin/somecommand -f -a'],
    }

    If, in the future, you realize that you need to change the exec
    resource, now you have to change everything that REFERENCES IT too (since
    references use the title). I hit this pretty late in the game in my old
    job, and it became a bit tedious.


    On Wednesday, December 5, 2012 12:55:16 PM UTC-8, Ygor wrote:

    The info you are asking for is at the top of the Type Reference page:

    The namevar is the parameter used to uniquely identify a type
    instance. This is the parameter that gets assigned when a string is
    provided before the colon in a type declaration. In general, only
    developers will need to worry about which parameter is the namevar.

    “Sometimes I think the surest sign that intelligent life exists
    elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Ellison Marks" <gty...@gmail.com>
    To: puppet...@googlegroups.com
    Sent: Wednesday, December 5, 2012 3:49:49 PM
    Subject: Re: [Puppet Users] Slight oversight in the type documentation

    Yes, And while the command line tools and looking at the code are as
    accurate as ever, it would be nice to find that info on the type page as
    well.

    http://docs.puppetlabs.com/**ref**erences/latest/type.html<http://docs.puppetlabs.com/references/latest/type.html>

    On Wednesday, December 5, 2012 12:44:50 PM UTC-8, Gary Larizza wrote:

    Hi Ellison,


    You can do `puppet decribe <type>` from the command line and it should
    tell you which attribute is the namevar for that type. Most types use
    'name' for their namevar, but some (like file) do not. Hope that helps!



    On Wed, Dec 5, 2012 at 11:46 AM, Ellison Marks < gty...@gmail.com >
    wrote:


    So I was looking at the type reference, and noticed that for a lot of
    the types, no namevar was listed. When I checked the types in the code, for
    each of those omissions, the namevar was simply "name". Now, it might be
    self evident that this is the case, but a little documentation couldn't
    hurt, If not in each type, at least in the section where it describes what
    namevars are. Something like: "If namevar is not specified, assumed that it
    is 'name'".


    --
    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/*
    *ms**g/puppet-users/-/**xtGOPopeEHoJ<https://groups.google.com/d/msg/puppet-users/-/xtGOPopeEHoJ>.
    To post to this group, send email to puppet...@googlegroups.com .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.**c**om .
    For more options, visit this group at http://groups.google.com/**group
    **/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>.




    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs


    --
    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/*
    *ms**g/puppet-users/-/**SdYgGWyMuzsJ<https://groups.google.com/d/msg/puppet-users/-/SdYgGWyMuzsJ>.
    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.**com.
    For more options, visit this group at http://groups.google.com/**group
    **/puppet-users?hl=en<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 view this discussion on the web visit https://groups.google.com/d/**
    msg/puppet-users/-/**NAIg8EIroOsJ<https://groups.google.com/d/msg/puppet-users/-/NAIg8EIroOsJ>
    .

    To post to this group, send email to puppet...@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users...@**
    googlegroups.com.
    For more options, visit this group at http://groups.google.com/**
    group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en>
    .


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs
    --
    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/-/kS5QTo0A7noJ.

    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.


    --

    Gary Larizza
    Professional Services Engineer
    Puppet Labs
    --
    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/-/OGZdY0hNBQQJ.
    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.
  • Dan White at Dec 6, 2012 at 1:07 am
    That is as good a reason as any I can think of: advance planning.
    Thanks for sharing.
    On Dec 5, 2012, at 4:38 PM, Ellison Marks wrote:

    As to why is this a concern, I don't know yet what I might use namevar for (not writing manifests, as I've just been told :P), but if or when that time comes, I want to be able to find out what the namevars are by looking at the documentation.
    --
    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 5, '12 at 7:46p
activeDec 6, '12 at 1:07a
posts11
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase