Skip to content

Instantly share code, notes, and snippets.

@jaredcurtis
jaredcurtis / gist:9519725
Created March 13, 2014 00:39
postgres settings fact
def pg_setting(setting)
Facter.add("pg_" + setting) do
setcode do
if File.exists? "/usr/bin/psql"
setting = Facter::Util::Resolution.exec("sudo -u postgres psql -U postgres -d postgres -qtAXc \"select current_setting('#{setting}')\"")
end
end
end
end
@jaredcurtis
jaredcurtis / gist:1904714
Created February 24, 2012 23:56
rebuild kernel module on update
class kernel(version='latest') {
package { 'rhel-kernel':
ensure => $version,
alias => kernel,
notify => Exec['rebuild gahrbaj'],
}
@jaredcurtis
jaredcurtis / gist:1895347
Created February 23, 2012 22:14
sorted hash in puppet templates
databases => {
'default' =>
{
'ENGINE' => 'postgresql_psycopg2',
'NAME' => 'defaultdb',
'HOST' => '2.2.2.2.2',
'USER' => 'username',
'PASSWORD' => 'secretinfo',
'OPTIONS' =>
{