Improve management of piwik plugins
authorTom Hughes <tom@compton.nu>
Tue, 6 Jan 2015 09:19:16 +0000 (09:19 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 6 Jan 2015 09:25:04 +0000 (09:25 +0000)
cookbooks/piwik/attributes/default.rb
cookbooks/piwik/recipes/default.rb
cookbooks/piwik/templates/default/config.erb

index efe8136..b044d41 100644 (file)
@@ -1 +1,13 @@
 default[:piwik][:version] = "2.10.0"
+default[:piwik][:plugins] = [
+  "Actions", "API", "BulkTracking", "Contents", "CoreAdminHome",
+  "CoreConsole", "CoreHome", "CorePluginsAdmin", "CoreUpdater",
+  "CoreVisualizations", "CustomVariables", "Dashboard",
+  "DevicesDetection", "DevicePlugins", "DoNotTrack", "Feedback",
+  "Goals", "ImageGraph", "Installation", "LanguagesManager", "Live",
+  "Login", "Morpheus", "MultiSites", "PrivacyManager", "Provider",
+  "Proxy", "Referrers", "Resolution", "SEO", "SitesManager",
+  "UserCountry", "UserCountryMap", "UserSettings", "UsersManager",
+  "Widgetize", "VisitFrequency", "VisitorInterest", "VisitsSummary",
+  "VisitTime"
+]
index 376b96e..1366d72 100644 (file)
@@ -67,7 +67,9 @@ template "/opt/piwik-#{version}/piwik/config/config.ini.php" do
   owner "root"
   group "root"
   mode "0644"
-  variables :passwords => passwords
+  variables :passwords => passwords,
+            :directory => "/opt/piwik-#{version}/piwik", 
+            :plugins => node[:piwik][:plugins]
 end
 
 directory "/opt/piwik-#{version}/piwik/tmp" do
index cea82b6..744f7cd 100644 (file)
@@ -15,90 +15,14 @@ trusted_hosts[] = "piwik.openstreetmap.org"
 salt = "<%= @passwords['salt'] %>"
 
 [Plugins]
-Plugins[] = "CorePluginsAdmin"
-Plugins[] = "CoreAdminHome"
-Plugins[] = "CoreHome"
-Plugins[] = "Proxy"
-Plugins[] = "API"
-Plugins[] = "Widgetize"
-Plugins[] = "LanguagesManager"
-Plugins[] = "Actions"
-Plugins[] = "Dashboard"
-Plugins[] = "MultiSites"
-Plugins[] = "UserSettings"
-Plugins[] = "Goals"
-Plugins[] = "SEO"
-Plugins[] = "UserCountry"
-Plugins[] = "VisitsSummary"
-Plugins[] = "VisitFrequency"
-Plugins[] = "VisitTime"
-Plugins[] = "VisitorInterest"
-Plugins[] = "ExampleAPI"
-Plugins[] = "ExamplePlugin"
-Plugins[] = "ExampleRssWidget"
-Plugins[] = "Provider"
-Plugins[] = "Feedback"
-Plugins[] = "Login"
-Plugins[] = "UsersManager"
-Plugins[] = "SitesManager"
-Plugins[] = "Installation"
-Plugins[] = "CoreUpdater"
-Plugins[] = "UserCountryMap"
-Plugins[] = "Live"
-Plugins[] = "CustomVariables"
-Plugins[] = "PrivacyManager"
-Plugins[] = "ImageGraph"
-Plugins[] = "DoNotTrack"
-Plugins[] = "DevicesDetection"
-Plugins[] = "Referrers"
-Plugins[] = "CoreConsole"
-Plugins[] = "CoreVisualizations"
-Plugins[] = "Morpheus"
-Plugins[] = "Contents"
+<% @plugins.each do |plugin| -%>
+Plugins[] = "<%= plugin %>"
+<% end -%>
 
 [PluginsInstalled]
-PluginsInstalled[] = "Login"
-PluginsInstalled[] = "CoreAdminHome"
-PluginsInstalled[] = "UsersManager"
-PluginsInstalled[] = "SitesManager"
-PluginsInstalled[] = "Installation"
-PluginsInstalled[] = "CorePluginsAdmin"
-PluginsInstalled[] = "CoreHome"
-PluginsInstalled[] = "Proxy"
-PluginsInstalled[] = "API"
-PluginsInstalled[] = "Widgetize"
-PluginsInstalled[] = "LanguagesManager"
-PluginsInstalled[] = "Actions"
-PluginsInstalled[] = "Dashboard"
-PluginsInstalled[] = "MultiSites"
-PluginsInstalled[] = "UserSettings"
-PluginsInstalled[] = "Goals"
-PluginsInstalled[] = "SEO"
-PluginsInstalled[] = "UserCountry"
-PluginsInstalled[] = "VisitsSummary"
-PluginsInstalled[] = "VisitFrequency"
-PluginsInstalled[] = "VisitTime"
-PluginsInstalled[] = "VisitorInterest"
-PluginsInstalled[] = "ExampleAPI"
-PluginsInstalled[] = "ExamplePlugin"
-PluginsInstalled[] = "ExampleRssWidget"
-PluginsInstalled[] = "ExampleFeedburner"
-PluginsInstalled[] = "Provider"
-PluginsInstalled[] = "Feedback"
-PluginsInstalled[] = "CoreUpdater"
-PluginsInstalled[] = "UserCountryMap"
-PluginsInstalled[] = "Live"
-PluginsInstalled[] = "CustomVariables"
-PluginsInstalled[] = "PrivacyManager"
-PluginsInstalled[] = "GeoIP"
-PluginsInstalled[] = "ImageGraph"
-PluginsInstalled[] = "DoNotTrack"
-PluginsInstalled[] = "DevicesDetection"
-PluginsInstalled[] = "CoreConsole"
-PluginsInstalled[] = "CoreVisualizations"
-PluginsInstalled[] = "Referrers"
-PluginsInstalled[] = "Morpheus"
-PluginsInstalled[] = "Contents"
+<% Dir.new("#{@directory}/plugins").reject { |f| f =~ /\./ }.sort.each do |plugin| -%>
+PluginsInstalled[] = "<%= plugin %>"
+<% end -%>
 
 [Plugins_Tracker]
 Plugins_Tracker[] = "Provider"