1 def get_debianfamily_postgres_version
2 case Facter.value('operatingsystem')
4 get_debian_postgres_version()
6 get_ubuntu_postgres_version()
12 def get_debian_postgres_version
13 case Facter.value('operatingsystemrelease')
14 # TODO: add more debian versions or better logic here
17 when /^wheezy/, /^7\./
24 def get_ubuntu_postgres_version
25 case Facter.value('operatingsystemrelease')
26 when "11.10", "12.04", "12.10", "13.04"
28 when "10.04", "10.10", "11.04"
35 def get_redhatfamily_postgres_version
36 case Facter.value('operatingsystemrelease')
46 Facter.add("postgres_default_version") do
49 case Facter.value('osfamily')
51 get_redhatfamily_postgres_version()
53 get_redhatfamily_postgres_version()
55 get_debianfamily_postgres_version()
60 # TODO: not sure if this is really a great idea, but elsewhere in the code
61 # it is useful to be able to distinguish between the case where the fact
62 # does not exist at all (e.g., if pluginsync is not enabled), and the case
63 # where the fact is not known for the OS in question.