Skip to content

Commit

Permalink
Add MySQL data_dir attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed May 5, 2015
1 parent 263576f commit 0e63402
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,19 @@ Attributes
</tr>
<tr>
<td><code>node['owncloud']['database']['instance']</code></td>
<td>mySQL database instance name to run by the mysql_service lwrp from the mysql cookbook</td>
<td>MySQL database instance name to run by the mysql_service lwrp from the mysql cookbook</td>
<td><code>"default"</code></td>
</tr>
<tr>
<td><code>node['owncloud']['database']['version']</code></td>
<td>mySQL version to install by the mysql_service lwrp. Refer to https://github.com/chef-cookbooks/mysql#platform-support</td>
<td>MySQL version to install by the mysql_service lwrp. Refer to https://github.com/chef-cookbooks/mysql#platform-support</td>
<td><code>nil</code></td>
</tr>
<tr>
<td><code>node['owncloud']['database']['data_dir']</code></td>
<td>MySQL data files path</td>
<td><em>calculated</em></td>
</tr>
</table>

Recipes
Expand Down
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
default['owncloud']['cron']['month'] = '*'
default['owncloud']['cron']['weekday'] = '*'

default['owncloud']['database']['data_dir'] = '/var/lib/mysql'
default['owncloud']['database']['instance'] = 'default'
default['owncloud']['database']['rootpassword'] = nil
default['owncloud']['database']['version'] = nil
14 changes: 10 additions & 4 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,22 @@
:required => 'optional'

attribute 'owncloud/database/instance',
:display_name => 'mySQL database instance name',
:description => 'mySQL database instance name to run by the mysql_service lwrp from the mysql cookbook',
:display_name => 'MySQL database instance name',
:description => 'MySQL database instance name to run by the mysql_service lwrp from the mysql cookbook',
:type => 'string',
:required => 'optional',
:default => '"default"'

attribute 'owncloud/database/version',
:display_name => 'mySQL server version',
:description => 'mySQL version to install by the mysql_service lwrp. Refer to https://github.com/chef-cookbooks/mysql#platform-support',
:display_name => 'MySQL server version',
:description => 'MySQL version to install by the mysql_service lwrp. Refer to https://github.com/chef-cookbooks/mysql#platform-support',
:type => 'string',
:required => 'optional',
:default => 'nil'

attribute 'owncloud/database/data_dir',
:display_name => 'MySQL server data dir',
:description => 'MySQL data files path',
:type => 'string',
:required => 'optional',
:calculated => true
1 change: 1 addition & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
action :install
end
mysql_service dbinstance do
data_dir node['owncloud']['database']['data_dir']
version node['owncloud']['database']['version']
bind_address '127.0.0.1'
port '3306'
Expand Down

0 comments on commit 0e63402

Please sign in to comment.