On Wed, Jun 8, 2011 at 1:43 PM, Adrien Thebo <[email protected]> wrote:

> Added osfamily fact to determine if a given operating system is a
> derivative of a common operating system.
>

Huge +1


> Signed-off-by: Adrien Thebo <[email protected]>
> ---
> Local-branch: ticket/master/6792
>  lib/facter/osfamily.rb |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
>  create mode 100644 lib/facter/osfamily.rb
>
> diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
> new file mode 100644
> index 0000000..b580034
> --- /dev/null
> +++ b/lib/facter/osfamily.rb
> @@ -0,0 +1,24 @@
> +# Fact: osfamily
> +#
> +# Purpose: Returns the operating system
> +#
> +# Resolution:
> +#   On Redhat and derivatives, returns redhat
> +#   On Debian and derivatives, returns debian
> +#   Else, returns the kernel
> +#
> +# Caveats:
> +#
> +
> +Facter.add(:osfamily) do
> +
> +  setcode do
> +    if FileTest.exists?("/etc/redhat-release")
> +      "redhat"
> +    elsif FileTest.exists?("/etc/debian_version")
> +      "debian"
> +    else
> +      Facter.kernel
> +    end
> +  end
> +end
> --
> 1.7.4.1
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to