Created
January 6, 2014 09:05
-
-
Save kietdlam/8280086 to your computer and use it in GitHub Desktop.
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
include_recipe "database::postgresql" | |
postgresql_connection_info = { | |
:host => '127.0.0.1', | |
:port => 5432, | |
:username => 'postgres', | |
:password => node['postgresql']['password']['postgres'] | |
} | |
# Do the same but pass the provider to the database resource | |
database_user 'ktklam9' do | |
connection postgresql_connection_info | |
password 'ktklam9' | |
provider Chef::Provider::Database::PostgresqlUser | |
action :create | |
end | |
postgresql_database_user 'ktklam9' do | |
connection postgresql_connection_info | |
password 'ktklam9' | |
action :grant | |
end | |
# restart the cluster to pick up changes | |
service 'postgresql' do | |
supports :restart => true | |
action :restart | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment