facter-plugins-1.1/0000755000175000017500000000000011573224775014473 5ustar kirklandkirklandfacter-plugins-1.1/ChangeLog0000644000175000017500000000056511573224775016253 0ustar kirklandkirklandfacter-plugins (1.1) unreleased; urgency=low * Release 1.1, refactor code and paths -- Juan L. Negron Mon, 06 Jun 2011 10:01:19 -0700 facter-plugins (1.0-0ubuntu1) oneiric; urgency=low * Initial release * debian/facter-customfacts-plugin.install: - Fixed install path -- Juan L. Negron Mon, 06 Jun 2011 10:01:12 -0700 facter-plugins-1.1/facter-customfacts-plugin/0000755000175000017500000000000011573224667021564 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/0000755000175000017500000000000011573224667022375 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/bin/0000755000175000017500000000000011573224667023145 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/bin/fact-add0000755000175000017500000000217111573224667024537 0ustar kirklandkirkland#!/bin/sh -e # # fact-add - facter plugin to insert custom facts # Copyright (C) 2011 Canonical Ltd. # # Authors: Juan L. Negron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Global Variables FACTS_DIR=/etc/facts # Check for Fact Name if [ ! -n "$1" ]; then echo "Fact name is needed" exit 1 else FACT_NAME=$1 fi # Check for Fact Value if [ ! -n "$2" ]; then echo "Fact value is needed" exit 1 else FACT_VALUE=$2 fi if [ ! -d ${FACTS_DIR} ]; then mkdir -p ${FACTS_DIR} fi echo "${FACT_VALUE}" > ${FACTS_DIR}/${FACT_NAME} exit 0 facter-plugins-1.1/facter-customfacts-plugin/usr/bin/fact-del0000755000175000017500000000211011573224667024544 0ustar kirklandkirkland#!/bin/sh -e # # fact-del - facter plugin to remove custom facts # Copyright (C) 2011 Canonical Ltd. # # Authors: Juan L. Negron # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Global Variables FACTS_DIR=/etc/facts # Check for Fact Name if [ ! -n "$1" ]; then echo "Fact name is needed" exit 1 else FACT_NAME=$1 fi if [ ! -d ${FACTS_DIR} ]; then exit 0 fi if [ -e ${FACTS_DIR}/${FACT_NAME} ]; then rm -f ${FACTS_DIR}/${FACT_NAME} else echo "Fact does not exists." exit 1 fi exit 0 facter-plugins-1.1/facter-customfacts-plugin/usr/lib/0000755000175000017500000000000011573224667023143 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/lib/ruby/0000755000175000017500000000000011573224667024124 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/lib/ruby/1.8/0000755000175000017500000000000011573224667024432 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/lib/ruby/1.8/facter/0000755000175000017500000000000011573224667025676 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/lib/ruby/1.8/facter/customfacts.rb0000644000175000017500000000044211573224667030556 0ustar kirklandkirkland# Custom facts custom_facts_path = "/etc/facts/*" Dir.glob(custom_facts_path).each do |fact_file| Facter.add(fact_file.split(File::SEPARATOR)[-1]) do setcode do begin File.new(fact_file, "r").gets.chomp rescue => err end end end end facter-plugins-1.1/facter-customfacts-plugin/usr/share/0000755000175000017500000000000011573224667023477 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/share/man/0000755000175000017500000000000011573224667024252 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/share/man/man1/0000755000175000017500000000000011573224667025106 5ustar kirklandkirklandfacter-plugins-1.1/facter-customfacts-plugin/usr/share/man/man1/fact-add.10000644000175000017500000000246211573224667026637 0ustar kirklandkirkland.TH fact-add 1 "26 May 2011" fact-add "fact-add" .SH NAME fact-add \- wrapper script for adding custom facts to facter .SH SYNOPSIS \fBfact-add\fP FACT [VALUE] .SH DESCRIPTION \fBfact-add\fP is a script that adds new facts with an optional value into facter. Note that facts are stored in \fI/etc/facts\fP where the filename is the new fact and the contents of the file is the current value of the fact. Facts created by \fBfact-add\fP can be deleted with \fBfact-del\fP. The FACT parameters is the new fact to be created. If a value is needed for the new fact the VALUE parameter is passed as well. .SH EXIT CODES \fBfact-add\fP returns 0 on success and 1 otherwise. .SH SEE ALSO .PD 0 .TP \fBfacter\fP(1) .TP \fBfact-del\fP(1) .PD .SH AUTHOR This manpage and the utility were written by Juan L. Negron for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document and the utility under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP. facter-plugins-1.1/facter-customfacts-plugin/usr/share/man/man1/fact-del.10000644000175000017500000000215111573224667026646 0ustar kirklandkirkland.TH fact-del 1 "26 May 2011" fact-add "fact-add" .SH NAME fact-del \- wrapper script for deleting custom facts to facter .SH SYNOPSIS \fBfact-add\fP FACT .SH DESCRIPTION \fBfact-del\fP is a script that removes facts created with \fBfact-add\fP from facter. Note that facts are stored in \fI/etc/facts\fP where the filename is the new fact and the contents of the file is the current value of the fact. .SH EXIT CODES \fBfact-del\fP returns 0 on success and 1 otherwise. .SH SEE ALSO .PD 0 .TP \fBfacter\fP(1) .TP \fBfact-add\fP(1) .PD .SH AUTHOR This manpage and the utility were written by Juan L. Negron for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document and the utility under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP.