chef-mysql-example

Python code posted
created at 27 Feb 10:52, updated at 04 Mar 19:46

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
##
# install mysql
##

include_recipe 'mysql::server'


##
# add mos user/db
##

include_recipe 'database::mysql'

mysql_connection_info = {:host => "localhost",
                         :username => 'root',
                         :password => node['mysql']['server_root_password']}

mysql_database 'mos' do
  connection mysql_connection_info
  action :create
end

mysql_database_user 'mos' do
  connection mysql_connection_info
  password 'mos'
  database_name 'mos'
  action :grant
end
516 Bytes in 4 ms with coderay