From ec51482863737bcd93b22f1898c2ed2ba43cd8e4 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 25 Jan 2017 16:03:23 +0100 Subject: [PATCH] library/roles: d4s_user_services_perms, fixes to the tasks so that they work if we have multiple tomcat installations but only a subset of them have smartgears installed. library/roles/smartgears/smartgears/templates/container.xml.j2: Cosmetic fix. --- d4s_user_services_perms/tasks/d4s-smartgears-node.yml | 4 ++++ smartgears/smartgears/templates/container.xml.j2 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/d4s_user_services_perms/tasks/d4s-smartgears-node.yml b/d4s_user_services_perms/tasks/d4s-smartgears-node.yml index 1b2ffa93..ab025492 100644 --- a/d4s_user_services_perms/tasks/d4s-smartgears-node.yml +++ b/d4s_user_services_perms/tasks/d4s-smartgears-node.yml @@ -8,6 +8,7 @@ with_nested: - '{{ tomcat_m_instances | default([]) }}' - [ 'startContainer.sh', 'stopContainer.sh' ] + when: not item.0.skip_smartgears tags: [ 'tomcat', 'd4science', 'sudo' ] - name: Install the README file that explains where the options files are placed and how start/stop the service @@ -15,6 +16,7 @@ with_nested: - '{{ tomcat_m_instances | default([]) }}' - [ 'README' ] + when: not item.0.skip_smartgears tags: [ 'tomcat', 'd4science', 'd4s_readme' ] # - name: Set the read/write permissions on the tomcat default options files @@ -27,11 +29,13 @@ - name: Set the read/write permissions on the tomcat default options files acl: name=/etc/default/tomcat-instance-{{ item.http_port }} entity={{ item.user }} etype=user permissions=rw state=present with_items: '{{ tomcat_m_instances | default([]) }}' + when: not item.skip_smartgears tags: [ 'tomcat', 'd4science', 'acl' ] - name: Set the read/write permissions on the tomcat default local options files acl: name=/etc/default/tomcat-instance-{{ item.http_port }}.local entity={{ item.user }} etype=user permissions=rw state=present with_items: '{{ tomcat_m_instances | default([]) }}' + when: not item.skip_smartgears tags: [ 'tomcat', 'd4science', 'acl' ] ignore_errors: True diff --git a/smartgears/smartgears/templates/container.xml.j2 b/smartgears/smartgears/templates/container.xml.j2 index d0845d94..9f20eac1 100644 --- a/smartgears/smartgears/templates/container.xml.j2 +++ b/smartgears/smartgears/templates/container.xml.j2 @@ -1,7 +1,7 @@ {{ smartgears_hostname }} - {%if setup_nginx %} + {% if setup_nginx %} {% if https_port is defined %} {% if http_redirect_to_https is defined and http_redirect_to_https %} {{ https_port }}