Skip to content

Commit

Permalink
update attributes and usage text
Browse files Browse the repository at this point in the history
  • Loading branch information
avsh committed Apr 2, 2015
1 parent 22a2a4f commit f686605
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ Attributes
<td>Type of database, can be sqlite, mysql or pgsql</td>
<td><code>"mysql"</code></td>
</tr>
<tr>
<td><code>node['owncloud']['config']['dbinstance']</code></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']['config']['dbversion']</code></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']['config']['dbname']</code></td>
<td>Name of the ownCloud database</td>
Expand All @@ -225,10 +235,15 @@ Attributes
<td>Password to access the ownCloud database</td>
<td><em>calculated</em></td>
</tr>
<tr>
<td><code>node['owncloud']['config']['dbrootpassword']</code></td>
<td>Database admin password to access a database instance</td>
<td><em>calculated</em></td>
</tr>
<tr>
<td><code>node['owncloud']['config']['dbhost']</code></td>
<td>Host running the ownCloud database</td>
<td><code>"localhost"</code></td>
<td><code>"127.0.0.1"</code></td>
</tr>
<tr>
<td><code>node['owncloud']['config']['dbtableprefix']</code></td>
Expand Down Expand Up @@ -335,10 +350,7 @@ On the first run, several passwords will be automatically generated and stored i

* `node['owncloud']['admin']['pass']`
* `node['owncloud']['config']['dbpassword']` (Only when using *MySQL* or *PostgreSQL*)
* `node['mysql']['server_root_password']` (Only when using *MySQL*)
* `node['mysql']['server_repl_password']` (Only when using *MySQL*)
* `node['mysql']['server_debian_password']` (Only when using *MySQL*)
* `node['postgresql']['password']['postgres']` (Only when using *PosgreSQL*)
* `node['owncloud']['config']['dbrootpassword']` (Only when using *MySQL* or *PostgreSQL*)

When using Chef Solo, these passwords need to be set manually.

Expand Down
23 changes: 22 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,20 @@
:required => 'optional',
:default => '"mysql"'

attribute 'owncloud/config/dbinstance',
: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/config/dbversion',
: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/config/dbname',
:display_name => 'ownCloud Database Name',
:description => 'Name of the ownCloud database',
Expand All @@ -301,12 +315,19 @@
:type => 'string',
:required => 'optional'

attribute 'owncloud/config/dbrootpassword',
:display_name => 'Database Root Password',
:description => 'Database admin password to access a database instance',
:calculated => true,
:type => 'string',
:required => 'optional'

attribute 'owncloud/config/dbhost',
:display_name => 'ownCloud Database Host',
:description => 'Host running the ownCloud database',
:type => 'string',
:required => 'optional',
:default => '"localhost"'
:default => '"127.0.0.1"'

attribute 'owncloud/config/dbtableprefix',
:display_name => 'ownCloud Database Table Prefix',
Expand Down
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
when 'mysql'
if %w{ localhost 127.0.0.1 }.include?(node['owncloud']['config']['dbhost'])
# Install MySQL
dbinstance = node['owncloud']['config']['dbinstance'] = 'default'
dbinstance = node['owncloud']['config']['dbinstance']

mysql2_chef_gem dbinstance do
action :install
Expand Down

0 comments on commit f686605

Please sign in to comment.