From 0bc87f0cbfdc894f6e391cae2aa601bb54787b27 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sun, 12 Mar 2017 23:46:36 +0100 Subject: [PATCH] Replace custom fact with executable fact Should solve #4 --- facts.d/sabayon.sh | 5 +++++ lib/facter/operatingsystem.rb | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) create mode 100644 facts.d/sabayon.sh delete mode 100644 lib/facter/operatingsystem.rb diff --git a/facts.d/sabayon.sh b/facts.d/sabayon.sh new file mode 100644 index 0000000..b577c13 --- /dev/null +++ b/facts.d/sabayon.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ -f /etc/sabayon-release ]; then + echo "operatingsystem=Sabayon" +fi diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb deleted file mode 100644 index 8c1ccbb..0000000 --- a/lib/facter/operatingsystem.rb +++ /dev/null @@ -1,11 +0,0 @@ -Facter.add(:operatingsystem) do - # Sabayon Linux is a variant of Gentoo so this resolution needs to come - # before the Gentoo resolution. - has_weight(100) - confine kernel: :linux, lsbdistid: :sabayon - - setcode do - 'Sabayon' - end - end -