From 7413e6398acb3db377856cc584db4b259b38280a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 Mar 2016 15:19:25 +0100 Subject: [PATCH] library/roles/tomcat, library/roles/tomcat-multiple-instances: Fix other ansible 2 incompatibilities. --- tomcat-multiple-instances/handlers/main.yml | 10 +++++----- tomcat-multiple-instances/tasks/main.yml | 2 +- tomcat/handlers/main.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tomcat-multiple-instances/handlers/main.yml b/tomcat-multiple-instances/handlers/main.yml index b34ac94d..b4a70f83 100644 --- a/tomcat-multiple-instances/handlers/main.yml +++ b/tomcat-multiple-instances/handlers/main.yml @@ -1,28 +1,28 @@ --- - name: tomcat restart instances with changed configs - service: name=tomcat-instance-'{{ item.item.http_port }}' state=restarted sleep=20 + service: name='tomcat-instance-{{ item.item.http_port }}' state=restarted sleep=20 with_items: restart_needed.results when: item.changed ignore_errors: True - name: tomcat restart instances with changed jmx config - service: name=tomcat-instance-'{{ item.item.http_port }}' state=restarted sleep=20 + service: name='tomcat-instance-{{ item.item.http_port }}' state=restarted sleep=20 with_items: jmx_restart_needed.results when: item.changed ignore_errors: True - name: tomcat instances restart - service: name=tomcat-instance-'{{ item.http_port }}' state=restarted sleep=20 + service: name='tomcat-instance-{{ item.http_port }}' state=restarted sleep=20 with_items: tomcat_m_instances ignore_errors: True - name: enable tomcat instances - service: name=tomcat-instance-'{{ item.http_port }}' state=started enabled=yes sleep=20 + service: name='tomcat-instance-{{ item.http_port }}' state=started enabled=yes sleep=20 with_items: tomcat_m_instances ignore_errors: True - name: disable tomcat instances - service: name=tomcat-instance-'{{ item.http_port }}' state=stopped enabled=no sleep=20 + service: name='tomcat-instance-{{ item.http_port }}' state=stopped enabled=no sleep=20 with_items: tomcat_m_instances ignore_errors: True diff --git a/tomcat-multiple-instances/tasks/main.yml b/tomcat-multiple-instances/tasks/main.yml index 35d372a4..412aa6de 100644 --- a/tomcat-multiple-instances/tasks/main.yml +++ b/tomcat-multiple-instances/tasks/main.yml @@ -3,7 +3,7 @@ # Note: the library role 'tomcat' is a dependency # - name: disable the tomcat main instance - service: name=tomcat'{{ tomcat_version }}' state=stopped enabled=no + service: name='tomcat{{ tomcat_version }}' state=stopped enabled=no when: not tomcat_service_enabled tags: [ 'tomcat', 'tomcat_instances' ] diff --git a/tomcat/handlers/main.yml b/tomcat/handlers/main.yml index 058d7a4e..d6efc316 100644 --- a/tomcat/handlers/main.yml +++ b/tomcat/handlers/main.yml @@ -1,12 +1,12 @@ --- - name: tomcat restart - service: name=tomcat'{{ tomcat_version }}' state=restarted sleep=20 + service: name='tomcat{{ tomcat_version }}' state=restarted sleep=20 when: tomcat_service_enabled - name: enable tomcat - service: name=tomcat'{{ tomcat_version }}' state=started enabled=yes + service: name='tomcat{{ tomcat_version }}' state=started enabled=yes when: tomcat_service_enabled - name: disable tomcat - service: name=tomcat'{{ tomcat_version }}' state=started enabled=no + service: name='tomcat{{ tomcat_version }}' state=started enabled=no when: not tomcat_service_enabled