--- - block: - name: Remove the old spd files file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=absent when: spd_service_upgrade # NOTE: Install as the smartgears user so we do not mess with the permissions - name: Get the spd-service maven_artifact: artifact_id={{ spd_service_name }} version={{ spd_service_version | default(omit) }} group_id={{ spd_group_id }} extension={{ spd_extension | default('war') }} repository_url={{ spd_service_repository_url }} dest={{ smartgears_user_home }}/{{ spd_service_file }} - name: Create the spd working directory file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} - name: Unarchive the spd war unarchive: copy=no src={{ smartgears_user_home }}/{{ spd_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ spd_service_name }}/WEB-INF/lib notify: Restart smartgears become: True become_user: '{{ d4science_user }}' when: spd_service_install tags: [ 'smartgears', 'spd_service', 'tomcat' ] - block: - name: Remove the old spd files file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=absent become: True become_user: '{{ d4science_user }}' when: not spd_service_install tags: [ 'smartgears', 'spd_service', 'tomcat' ]