Commit fca59cea authored by André Kerkhoff's avatar André Kerkhoff
Browse files

Make it possible to disable SitePreferences and WebPreferences

parent df342a1b
......@@ -66,13 +66,13 @@ The default recipe can create topics and thereby remove their existing history.
### System.SitePreferences
You can configure site preferences with attributes under `['foswiki']['site_preferences']`.
You can configure site preferences with attributes under `['foswiki']['site_preferences']`. To disable management of the topic set `['foswiki']['site_preferences']['disable']` to `true`.
For custom installations you declare a Chef template using `SitePreferences.txt.erb` as source.
### WEB.WebPreferences
Web preferences can be configured under `['foswiki']['web_preferences'][web]`. The `System` web is predefined.
Web preferences can be configured under `['foswiki']['web_preferences'][web]`. The `System` web is predefined. To disable management of the topics set `['foswiki']['web_preferences']['disable']` for all or `['foswiki']['web_preferences'][web]['disable']` for a specific web.
For custom installations you decare Chef templates using `WebPreferences.txt.erb` as source.
......
......@@ -3,7 +3,7 @@ maintainer 'HPC'
maintainer_email 'hpc@gsi.de'
license 'All rights reserved'
description 'Installs/Configures Foswiki'
version '2.2.4'
version '2.2.5'
depends 'apache2', '< 6.0'
supports 'debian'
supports 'ubuntu'
......@@ -90,27 +90,33 @@ unless node['foswiki']['admin_group'].nil?
end
# Manage Main.SitePreferences
template "#{foswiki_dir('data')}/Main/SitePreferences.txt" do
source 'SitePreferences.txt.erb'
variables(config: node['foswiki']['site_preferences'] || {})
end
directory "#{foswiki_dir('data')}/Main/SitePreferences,pfv" do
recursive true
action :delete
end
# Manage %WEB%.WebPreferences
(node['foswiki']['web_preferences'] || {}).each do |web, preferences|
template "#{foswiki_dir('data')}/#{web}/WebPreferences.txt" do
source 'WebPreferences.txt.erb'
variables(config: preferences || {})
unless node['foswiki']['site_preferences']['disable']
template "#{foswiki_dir('data')}/Main/SitePreferences.txt" do
source 'SitePreferences.txt.erb'
variables(config: node['foswiki']['site_preferences'] || {})
end
directory "#{foswiki_dir('data')}/#{web}/WebPreferences,pfv" do
directory "#{foswiki_dir('data')}/Main/SitePreferences,pfv" do
recursive true
action :delete
end
end
# Manage %WEB%.WebPreferences
unless node['foswiki']['web_preferences']['disable']
(node['foswiki']['web_preferences'] || {}).each do |web, preferences|
template "#{foswiki_dir('data')}/#{web}/WebPreferences.txt" do
source 'WebPreferences.txt.erb'
variables(config: preferences || {})
not_if { preferences['disable'] }
end
directory "#{foswiki_dir('data')}/#{web}/WebPreferences,pfv" do
recursive true
action :delete
not_if { preferences['disable'] }
end
end
end
# Manage other topics
(node['foswiki']['topics'] || {}).each do |topic, tcontent|
base = "#{foswiki_dir('data')}/#{topic.tr('.', '/')}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment