Created
August 30, 2012 16:53
-
-
Save russ/3533101 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
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) | |
app = data_bag_item('apps', 'bulletin_board') | |
app['mysql_root_password'][node.chef_environment] = node['mysql']['server_root_password'] | |
app['databases'][node.chef_environment]['password'] = secure_password | |
app.save | |
chef_gem 'mysql' do | |
action :install | |
end | |
mysql_database 'bulletin_board' do | |
connection ({ | |
:host => 'localhost', | |
:username => 'root', | |
:password => node['mysql']['server_root_password']}) | |
action :create | |
end | |
mysql_connection_info = { | |
:host => 'localhost', | |
:username => 'root', | |
:password => node['mysql']['server_root_password'] | |
} | |
mysql_database_user 'lvrug' do | |
connection mysql_connection_info | |
password data_bag_item('apps', 'bulletin_board')['databases'][node.chef_environment]['password'] | |
action :create | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment