Created
March 20, 2014 20:45
-
-
Save antaflos/9673440 to your computer and use it in GitHub Desktop.
is it possible to call a Puppet function like postgresql_password() when looking up data from Hiera (and using create_resources())?
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
--- | |
profile::postgresql::server::dbs: | |
redmine: | |
user: redmine | |
password: "postgresql_password('redmine', 'xxx')" | |
# The above results in puppetlabs-postgresql's Postgresql::Server::Role class | |
# passing the string "postgresql_password('redmine', 'xxx')" verbatim as | |
# ENCRYPTED PASSWORD to the ALTER ROLE statement postgresql_psql creates, which of course fails. |
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
# modules/profile/manifests/postgresql/server.pp | |
class profile::postgresql::server { | |
include '::postgresql::server' | |
include '::postgresql::server::contrib' | |
include '::postgresql::globals' | |
$dbs = hiera_hash('profile::postgresql::server::dbs', {}) | |
create_resources('::postgresql::server::db', $dbs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment