--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
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.
Shortly:
I would really rather that widely-used software stuck to the basic RFC conventions as much as possible.
More discussion:
I'm really curious to know know what your "various reasons" are. If you have a special requirement for oddly shaped hostnames I sympathize with you, since I imagine that it's because of some vendor or manager with very special ideas about the world. Possibly you'd be better off sending a patch that people can use to set a configuration option in puppet.conf to see your unique hostname requirement behaviour.
RFC-952 has this to say about periods:
'Note that periods are only allowed when they serve to delimit components of "domain style names".'
http://tools.ietf.org/html/rfc952
For instance, to my knowledge:
bob.office.division.company.com (fully qualified domain name)
bob (hostname, the actual computer's name)
office.division.company.com (domain)
bob.office.division (partially qualified domain name, so I've heard)
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> 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.
>
> References
>
> Visible links
> 1. https://projects.puppetlabs.com/issues/9766
'Note that periods are only allowed when they serve to delimit components of "domain style names".'
but I don't think that RFC quoting alone is going to give us the right answer as to whether we should do it or not.
Except that is the fqdn.
"I understand there are major implications to this and the task may be
challenging, one suggestion would be to set up another facter
parameter something like
uname.hostname
or
uname.domain
or perhaps a configuration parameter to use POSIX compliance parameters."
Which makes more sense.
Our concept of 'hostname' as a fact is equivalent to hostname -s up
until now - it doesn't mean the result of the 'hostname' command
necessarily.
ken.
Except that is the fqdn.
"I understand there are major implications to this and the task may be
challenging, one suggestion would be to set up another facter
parameter something like
uname.hostname
or
uname.domain
or perhaps a configuration parameter to use POSIX compliance parameters."
Which makes more sense.
Our concept of 'hostname' as a fact is equivalent to hostname -s up
until now - it doesn't mean the result of the 'hostname' command
necessarily.
Our concept of 'hostname' as a fact is equivalent to hostname -s up
until now - it doesn't mean the result of the 'hostname' command
necessarily.This makes sense and is an easy compromise. Could I suggest the doco reflect that $hostname is `hostname -s`?
1) New fact that maps closer to the 'hostname' command (for example)
2) Configuration item that changes behaviour of the hostname fact.
Obviously we don't support configuration specifically in facter at
this point - but ignoring that for now - what would people prefer?
What would create the least amount of surprise? Or is there more
options available ...
ken.
about. In fact, I think if you were to use periods it would confuse
DNS resolve because it follows the same convention as stated in the
RFC. If I were external trying to look up host.server.domain.com, my
DNS would try to look for a nameserver for server.domain.com. You
would still be forced to use a new zone file for server.domain.com.
http://pubs.opengroup.org/onlinepubs/009604599/basedefs/sys/utsname.h.html
http://pubs.opengroup.org/onlinepubs/009695399/utilities/uname.html
For example ...
uname_nodename: is uname -n only and isn't contrived
uname_release: is uname -r
uname_version: is uname -v
...etc...
This duplicates a lot of facts in behaviour - but sticks to the posix
compliance interpretation only. I'm not 100% on weither this is the
correct approach but the idea sounds sane enough - the question is
really if it is core worthy or not. If this is implemented how many
people would prefer or use this directly (besides Doug of course - who
has made his sentiments clear :-P)?
My main concern here is that this implementation is not truly
cross-platform - only POSIX specific (which is pretty good coverage
anyway - but not complete). The point and vision of facter (and most
puppet resources) is to provide cross-os compatibility where possible
if anything providing a later that binds POSIX and other non-posix OS
to one type of data ... so I see these facts as binding puppet content
to POSIX only machines. So while the interface may be there ... we
would want to be careful to avoid using it directly in cross-os
resources and puppet code. Having said that, this would not be the
first time we have had to provide OS specific facts :-).
IMO - If implemented I can envision providing this interface and on
POSIX machines just using these facts to glean things like
'kernelversion' on compatible machines instead of duplicating the
uname -v call again.
ken.
So just to be clear - I don't think we'll want to change the
'hostname' fact from its current behaviour. I think this is agreed
from all angles.
So the special case here that Doug is describing is when someone uses
a shorter name as the hostname on a box. For example
'mybox.mylocation' and the domain name has the trailing part
'mydomain.com'.
What I'm really curious about and need help understanding ... is to
find out who else is doing this on the list to figure out the value of
adding handling for this case.
ken.
So in this proposal we have 'hostname' which is defined as the
shortname, and 'uname_nodename' which is the data derived from the
system. One is cross-platform, the other is specific to POSIX systems
with the uname data available.
So if we created 'uname_nodename' this could be used internally be the
'hostname' fact if on a POSIX system that supports it. In OWL
ontological terms this is not a 'owl:sameAs' but a derived
relationship of some kind (?).
> It is usually useful to separate out the data returned from
> interrogation from how facter has interpreted it. Not least for
> debugging and provenance purposes.
Indeed. At the moment all facts are equal. I hope in the future name
spacing can logically separate facts out - but I'm not sure enough
metadata can be gleaned from namespaces - something to think about.
I agree though - there is value in the separation. not only to solve
the problem users are having here - but from a reporting/debugging
perspective you can see more clearly what the system is really set to
- not just how facter interprets it.
In fact there is a similar discussion for proper reporting for the
operatingsystem fact for windows:
http://projects.puppetlabs.com/issues/7643
http://projects.puppetlabs.com/issues/7621
In #7643 we talk about exposing all the Win32_OperatingSystem WMI/CIM
class vars ... and in #7621 we would simply use those for the
operatingsystem fact on windows. Real value/contrived value layers has
its value.
> fwiw, I'm also a big fan of encouraging best practice in the use of
> the tools, so in this instance, the teaching/documentation would show
> how to avoid naming pitfalls introduced by differences in standards
> and how to remediate an environment that's fallen into such a trap.
> Otherwise, the tools get bogged down in handling nasty
> inconsistencies, which are impossible to cope with cleanly in code as
> they depend on implicit or explicit customer organisational policies -
> and the tool gets blamed for any shortfalls, while the organisation
> keeps digging itself deeper into the trap.
It seems to me that most people have set the hostname to be the fqdn.
And in a way (for right or wrong) this has become a
pseudo-expectation. Not just for Puppet but for other things. I have
worked with Doug and Dexter in places where they have done this - and
have found myself working around issues in other places at times.
Thanks for your informed input :-).
ken.
Facter.add(:hostname) do
has_weight 200
setcode do
# your own hostname implementation
end
end
You can effectively override a fact by setting the weight, as follows
Facter.add(:hostname) do
has_weight 200
setcode do
# your own hostname implementation
end
end
To do this (in the cases it is necessary) I simply take the fqdn and use search/replace to replace the trailing domain name with nothing. So, no need to change facter as I can use fqdn.
$hostname = foo
$fqdn = foo.dept.auckland.ac.nz
$nagioshostname = regsubst( $fqdn, '(\.itss|\.no)?\.auckland\.ac\.nz$', '','I' )
This might be sufficuient for what the original poster was asking?
Of course, they could always define a custom fact to hold the output of uname if they prefer. One of the great things about the puppet/facter model is that you can do this with very little effort.
I would definitely not want to change the current behaviour of fqdn and hostname.
Steve
Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.sh...@auckland.ac.nz
Ph: +64 9 373 7599 ext 86487