Created
July 1, 2013 14:48
-
-
Save mathie/5901480 to your computer and use it in GitHub Desktop.
Since Puppet stopped passing environment variables down to subprocesses (like, say, `apt-get install`), I've occasionally run into problems where a package postinst script relies on something in the environment. The PostgreSQL package (on Ubuntu 12.04 at least) is one such beast. It relies on the current locale (gleamed from the environment) to …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class postgresql::server::config { | |
exec { | |
'postgresql-drop-cluster': | |
command => '/usr/bin/pg_dropcluster --stop 9.1 main', | |
onlyif => "/usr/bin/psql -c '\\l+' |awk '/template0/ { print \$5 }' |grep 'SQL_ASCII'", | |
user => postgres, | |
notify => Exec['postgresql-create-cluster']; | |
'postgresql-create-cluster': | |
command => '/usr/bin/pg_createcluster --locale=en_GB.UTF-8 9.1 main', | |
user => postgres, | |
refreshonly => true, | |
before => [ File['/etc/postgresql/9.1/main/postgresql.conf'], File['/etc/postgresql/9.1/main/pg_hba.conf'] ]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment