X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/79b2dc9bbd0a68715e59834e3fc10d3824cbea4a..6cf4a14058d61863ecb4522df528b59e83ec5edf:/cookbooks/otrs/recipes/default.rb diff --git a/cookbooks/otrs/recipes/default.rb b/cookbooks/otrs/recipes/default.rb index b557a7205..f16931b32 100644 --- a/cookbooks/otrs/recipes/default.rb +++ b/cookbooks/otrs/recipes/default.rb @@ -25,28 +25,57 @@ include_recipe "tools" passwords = data_bag_item("otrs", "passwords") -package "libapache2-mod-perl2" -package "libapache2-reload-perl" - package %w[ tar bzip2 + libapache-dbi-perl + libapache2-reload-perl + libarchive-zip-perl + libauthen-ntlm-perl + libauthen-sasl-perl libcrypt-eksblowfish-perl + libcss-minifier-xs-perl libdatetime-perl + libdbd-mysql-perl + libencode-hanextra-perl + libexcel-writer-xlsx-perl libgd-gd2-perl libgd-graph-perl libgd-text-perl + libhtml-parser-perl + libio-socket-ssl-perl + libjavascript-minifier-xs-perl + libjson-perl libjson-xs-perl + liblocale-codes-perl libmail-imapclient-perl libmoo-perl + libnet-dns-perl libnet-ldap-perl libpdf-api2-perl + libsisimai-perl libsoap-lite-perl + libspreadsheet-xlsx-perl libtemplate-perl + libtext-csv-xs-perl + libtext-diff-perl + libtimedate-perl + libxml-libxml-perl + libxml-libxml-simple-perl + libxml-libxslt-perl + libxml-parser-perl + libxml-simple-perl libyaml-libyaml-perl + libyaml-perl ] +apache_module "perl" do + package "libapache2-mod-perl2" +end + +apache_module "deflate" apache_module "headers" +apache_module "rewrite" version = node[:otrs][:version] user = node[:otrs][:user] @@ -98,18 +127,19 @@ file "/opt/znuny-#{version}/Kernel/Config.pm" do group "www-data" mode "664" content config + notifies :restart, "service[otrs]" end -link "/opt/otrs" do - to "/opt/znuny-#{version}" -end - -execute "/opt/otrs/bin/otrs.SetPermissions.pl" do - action :run - command "/opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=#{user} --web-group=www-data /opt/otrs-#{version}" +execute "/opt/znuny-#{version}/bin/otrs.SetPermissions.pl" do + action :nothing + command "/opt/znuny-#{version}/bin/otrs.SetPermissions.pl --otrs-user=#{user} --web-group=www-data /opt/znuny-#{version}" user "root" group "root" - only_if { File.stat("/opt/otrs/README.md").uid != Etc.getpwnam("otrs").uid } + subscribes :run, "execute[untar-znuny-#{version}]" +end + +link "/opt/otrs" do + to "/opt/znuny-#{version}" end systemd_service "otrs" do @@ -126,6 +156,7 @@ end service "otrs" do action [:enable, :start] + subscribes :restart, "link[/opt/otrs]" subscribes :restart, "systemd_service[otrs]" end @@ -139,11 +170,6 @@ apache_site site do variables :aliases => site_aliases end -# FIXME: Remove old otrs sudoers file -file "/etc/sudoers.d/otrs" do - action :delete -end - template "/etc/cron.daily/otrs-backup" do source "backup.cron.erb" owner "root"