Hi, I am seeing a direction which will need to puppet being a bit of a 
mess. i.e. Linux is the only OS.

Facts need to be prefixed by their OS.   e.g. win_ or unix_  If unix 
specific then lnx_ aix_ sol_ hpux_ etc
If the fact is not available or common to most OS it should be prefex... If 
Puppet wants to be king of all OS it needs to be design for all os include 
module name and facts.

e.g. http://docs.puppetlabs.com/facter/1.7/core_facts.html

blockdevice_{devicename}_vendor 

Returns the vendor name of block devices attached to the system.

*Resolution:* Parse the contents of /sys/block/{device}/device/vendor to 
retrieve the vendor for a device. 

*Caveats: *Only supports Linux 2.6+ at this time, due to the reliance on 
sysfs.
---
If the aim of this is to support all OS, and puppet labs is just starting 
with Linux that is fine. What are block devices on other OS and does it 
represent the same thing. Do we need to know if they are tape or disk or 
serial port etc.  Can we turn this off, on systems with hundreds of block 
devices?

Other wise if this is linux specific  I would suggest this should be in a 
module called linux_facts

Servers can have hundreds of devices, and a 3 facts per device seems the 
wrong approach. A hash (or jason/yaml) would be better solution. This the 
functions required to look through the hash...

For example the following should exist on most OS, but should be group 
together instead of a fact per interface.

   1. ipaddress6  (should not exist or be an array)
   <http://docs.puppetlabs.com/facter/1.7/core_facts.html#ipaddress6>
   2. ipaddress6_{NETWORK 
INTERFACE}<http://docs.puppetlabs.com/facter/1.7/core_facts.html#ipaddress6network-interface>
   3. network_{NETWORK 
INTERFACE}<http://docs.puppetlabs.com/facter/1.7/core_facts.html#networknetwork-interface>

We talk about removing data from modules... However in order to write 
generic modules facts need to be generic.
Writing code like if $::network_eth0 = x.x.x.x. 
if $::network_eth1 = x.x.x.x.
I have no way to know the the number of interfaces and their names.....

Facts need to come with functions to make them useful.
facts_regex2array(/^ipaddress6_.*/)  would help with the above. But facts 
need to support strings, hash and arrays.
e.g.
networkif_name=['eth0','eth1','eth2']
networkif_ip4=[192.168.0.1,192.168.1.1,192.168.2.1]
or in a hash (i like the above as less data to transfer then if it was a 
hash)

If puppet wants to be all things to all OS, then facts and modules need a 
prefix for the OS when the particular fact or module will only work on a 
particular OS.  Modules which do not follow this guide line should not be 
accepted by the forge if puppet wants to support many many OS.

What are other peoples thoughts.

Cheers




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/4cc7117b-1cf9-4bdc-8bcd-5118b99abe2c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to