cookbook 'ya-piwik', '~> 0.1.0'
ya-piwik (1) Versions 0.1.0 Follow0
Installs/Configures ya-piwik
cookbook 'ya-piwik', '~> 0.1.0', :supermarket
knife supermarket install ya-piwik
knife supermarket download ya-piwik
ya-piwik cookbook
This cookbook is install and management for piwik.
ya-piwik is an abbreviation for Yet Another Piwik.
Now, this cookbook you can in the following list:
- install piwik
- site management (create and update)
Requirements
Environment
- MySQL - piwik needs MySQL
Cookbooks
-
php
- ya-piwik needs php. -
nginx
- ya-piwik needs nginx ifnode['ya-piwik']['fpm']['enable']
wastrue
.
Operating Systems
- CentOS 6.0 or later
Attributes
ya-piwik::default
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['ya-piwik']['home']</tt></td>
<td>String</td>
<td>piwik install directory</td>
<td><tt>'/var/www/html/piwik/'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['fpm']['enable']</tt></td>
<td>Boolean</td>
<td>php-fpm enable <strong>(required <a href="https://github.com/priestjim/chef-php">php</a> cookbook)</strong></td>
<td><tt>true</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['fpm']['user']</tt></td>
<td>String</td>
<td>php-fpm usarname</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['fpm']['group']</tt></td>
<td>String</td>
<td>php-fpm group</td>
<td><tt>''</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['fpm']['socket']</tt></td>
<td>String</td>
<td>php-fpm socket name</td>
<td><tt>'/var/run/php-fpm/piwik.php-fpm.sock'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['host']</tt></td>
<td>String</td>
<td>database server host name</td>
<td><tt>'127.0.0.1'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['user']</tt></td>
<td>String</td>
<td>database user name</td>
<td><tt>'root'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['pass']</tt></td>
<td>String</td>
<td>database password</td>
<td><tt>'secret-password-here'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['name']</tt></td>
<td>String</td>
<td>database name</td>
<td><tt>'piwik'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['prefix']</tt></td>
<td>String</td>
<td>database table prefix</td>
<td><tt>''</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['database']['adapter']</tt></td>
<td>String</td>
<td>database adapter <tt>'MYSQL'</tt> or <tt>'MYSQLI'</tt></td>
<td><tt>'MYSQLI'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['root']['user']</tt></td>
<td>String</td>
<td>username of root user</td>
<td><tt>'root'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['root']['pass']</tt></td>
<td>String</td>
<td>password of root user</td>
<td><tt>'secret-password-here'</tt></td>
</tr>
<tr>
<td><tt>['ya-piwik']['root']['email']</tt></td>
<td>String</td>
<td>email of root user</td>
<td><tt>'piwik@example.net'</tt></td>
</tr>
</table>
LWRP
ya_piwik_site
this LWRP is create new or overwrite site to piwik.
Actions
<table>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><tt>:create</tt></td>
<td>create site configuration</td>
</tr>
</table>
Parameters
<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>idsite</tt></td>
<td>Fixnum</td>
<td>false</td>
<td>site id of site</td>
<td><tt>0</tt></td>
</tr>
<tr>
<td><tt>siteName</tt></td>
<td>String</td>
<td>true</td>
<td>site name of new site</td>
<td><tt> </tt></td>
</tr>
<tr>
<td><tt>urls</tt></td>
<td>String | String of Array</td>
<td>true</td>
<td>url of new site, Overwrite the site that matches the URL if not <tt>idsite</tt> specified</td>
<td><tt> </tt></td>
</tr>
<tr>
<td><tt>timezone</tt></td>
<td>String</td>
<td>false</td>
<td>timezone of new site</td>
<td><tt>'Asia/Tokyo'</tt></td>
</tr>
<tr>
<td><tt>ecommerce</tt></td>
<td>String</td>
<td>false</td>
<td>promote e-commerce of new site</td>
<td><tt>'0'</tt></td>
</tr>
</table>
Example
ya_piwik_site 'make piwik main site' do
idsite 1
siteName 'My blog'
urls 'http://blog.example.net/'
action :create
end
Libraries
YaPiwik::API class is call piwik API helper.
Example
api = YaPiwik::API.new(node.run_context)
idsite = api.site_id_from_site_url('http://blog.example.net/') # idsite => 1
Usage
ya-piwik::default
Just include ya-piwik
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[ya-piwik]" ] }
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Copyright (c) 2014 sharkpp
This cookbook is under The MIT License.
Full license text, please refer to the LICENSE
.
Dependent cookbooks
nginx >= 0.0.0 |
php >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: ya-piwik/metadata.rb:1
FC065: Ensure source_url is set in metadata: ya-piwik/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ya-piwik/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ya-piwik/metadata.rb:1
FC070: Ensure supports metadata defines valid platforms: ya-piwik/metadata.rb:1
FC076: Metadata uses the deprecated "conflicts" keyword: ya-piwik/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ya-piwik/providers/site.rb:64
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: ya-piwik/metadata.rb:1
FC065: Ensure source_url is set in metadata: ya-piwik/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ya-piwik/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ya-piwik/metadata.rb:1
FC070: Ensure supports metadata defines valid platforms: ya-piwik/metadata.rb:1
FC076: Metadata uses the deprecated "conflicts" keyword: ya-piwik/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ya-piwik/providers/site.rb:64
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
FC065: Ensure source_url is set in metadata: ya-piwik/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ya-piwik/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ya-piwik/metadata.rb:1
FC070: Ensure supports metadata defines valid platforms: ya-piwik/metadata.rb:1
FC076: Metadata uses the deprecated "conflicts" keyword: ya-piwik/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ya-piwik/providers/site.rb:64
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number