]> git.openstreetmap.org Git - chef.git/commitdiff
Fix OTRS updating
authorTom Hughes <tom@compton.nu>
Thu, 2 Jun 2016 20:28:37 +0000 (21:28 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 2 Jun 2016 20:39:44 +0000 (21:39 +0100)
cookbooks/otrs/recipes/default.rb

index c90b28940b3030bbba0615cac7f28029cef1dc00..0b810f4285cd9ceed0de59b9901427a792a84b64 100644 (file)
@@ -79,11 +79,15 @@ file "/opt/otrs-#{version}/Kernel/Config.pm" do
   content config
 end
 
+generic_agent = edit_file "/opt/otrs-#{version}/Kernel/Config/GenericAgent.pm.dist" do |line|
+  line
+end
+
 file "/opt/otrs-#{version}/Kernel/Config/GenericAgent.pm" do
   owner user
   group "www-data"
   mode 0664
-  content IO.read("/opt/otrs-#{version}/Kernel/Config/GenericAgent.pm.dist")
+  content generic_agent
 end
 
 link "/opt/otrs" do
@@ -95,7 +99,7 @@ execute "/opt/otrs/bin/otrs.SetPermissions.pl" do
   command "/opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=#{user} --web-user=www-data --otrs-group=www-data --web-group=www-data /opt/otrs-#{version}"
   user "root"
   group "root"
-  not_if { File.stat("/opt/otrs/README.md").uid != Etc.getpwnam("otrs").uid }
+  only_if { File.stat("/opt/otrs/README.md").uid != Etc.getpwnam("otrs").uid }
 end
 
 execute "/opt/otrs/bin/otrs.RebuildConfig.pl" do