custom facts in legacy puppet 0.24.[89]

3 views
Skip to first unread message

sHaggY_caT

unread,
Jun 18, 2010, 2:07:47 PM6/18/10
to Puppet Users
Hi all!

How i may use in legacy puppet (0.24.[89]) custom facts in functions?
In new documentation not good faq about this:
http://docs.reductivelabs.com/guides/plugins_in_modules.html this
documentation has information about new versions (25.5) and very old
(prior 0.24.4),
not about our 0.24.8 >>>> 0.24.9 (we in migration now, we don'nt may
change version to 25.[0-9] in production now becouse compability)

Also i try http://projects.puppetlabs.com/projects/puppet/wiki/Adding_Facts
my version of puppet don't know key of t and, my puppet don't retrive
facts. I'm put facts in dir:
/<module>/plugins/facter
also, i have module mod_mysql, and put fact:
/path_to_modules_of_this_enviroment/mod_mysql/plugins/facter/mysql.rb
http://paste.org.ru/?0rs4fb but client does'nt see this fact

i add in config of this enviroment option of pluginsync
also, i try add this fact in dir: /usr/lib/ruby/site_ruby/1.8/facter
manually.

Config of puppet enviroment and code of fact:

[root@puppet2 facter]# cat /var/lib/puppet/modules/modules_development/
mod_mysql/plugins/facter/mysql.rb
Facter.add("mysql_exists") do
ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"

setcode do
mysqlexists = system "which mysql > /dev/null 2>&1"
($?.exitstatus == 0)
end
end
[root@puppet2 facter]#

[root@puppet2 facter]# cat /etc/puppet/puppet.conf | grep -A4 "\
[development"
[development]
pluginsync = true
modulepath = /etc/puppet/projects:/var/lib/puppet/modules/
modules_development
manifest = /etc/puppet/manifests/development_site.pp

[root@puppet2 facter]#
Reply all
Reply to author
Forward
0 new messages