From ac277cb6afadbd50e30a382af310d24b59d591c8 Mon Sep 17 00:00:00 2001
From: Andrea Dell'Amico <adellam@isti.cnr.it>
Date: Fri, 8 Jul 2016 16:43:11 +0200
Subject: [PATCH] library/roles/smartgears/smartgears/tasks/smartgears-app.yml:
 Fix the command that sets the logback log level.

---
 smartgears/smartgears/tasks/smartgears-app.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml
index 7afaefb0..9d463285 100644
--- a/smartgears/smartgears/tasks/smartgears-app.yml
+++ b/smartgears/smartgears/tasks/smartgears-app.yml
@@ -64,7 +64,7 @@
 - name: Change the smartgears log level
   become: True
   become_user: '{{ d4science_user }}'
-  shell: LOGLEVEL=$( xmlstarlet sel -t -v "/configuration/logger/@level"  {{ item.user_home }}/tomcat/lib/logback.xml | grep {{ smartgears_loglevel }} ) ; [ $? -ne 0 ] && xmlstarlet ed -u "/configuration/logger[@level]/@level" -v {{ smartgears_loglevel }} {{ item.user_home }}/tomcat/lib/logback.xml > {{ item.user_home }}/tomcat/lib/logback.xml.new ; mv {{ item.user_home }}/tomcat/lib/logback.xml.new {{ item.user_home }}/tomcat/lib/logback.xml
+  shell: LOGLEVEL=$( xmlstarlet sel -t -v "/configuration/logger/@level"  {{ item.user_home }}/tomcat/lib/logback.xml | grep {{ smartgears_loglevel }} ) ; [ $? -ne 0 ] && xmlstarlet ed -u "/configuration/logger[@level]/@level" -v {{ smartgears_loglevel }} {{ item.user_home }}/tomcat/lib/logback.xml > {{ item.user_home }}/tomcat/lib/logback.xml.new ; [ -f {{ item.user_home }}/tomcat/lib/logback.xml.new ] && mv {{ item.user_home }}/tomcat/lib/logback.xml.new {{ item.user_home }}/tomcat/lib/logback.xml
   with_items: '{{ tomcat_m_instances }}'
   notify: Restart smartgears 
   tags: [ 'smartgears', 'tomcat', 'smartgears_loglevel' ]