--- - name: Remove the old smart executor files file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=absent when: - smart_executor_install - smartgears_upgrade tags: [ 'smartgears', 'tomcat' ] # NOTE: Install as the smartgears user so we do not mess with the permissions - name: Get the smart executor plugin get_url: url={{ smart_executor_url }} dest={{ smartgears_user_home }}/{{ smart_executor_file }} when: smart_executor_install tags: [ 'smartgears', 'smart_executor', 'tomcat' ] - name: Create the smart executor working directory file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} when: smart_executor_install tags: [ 'smartgears', 'smart_executor', 'tomcat' ] - name: Unarchive the smartexecutor distribution become: True become_user: '{{ smartgears_user }}' unarchive: copy=no src={{ smartgears_user_home }}/{{ smart_executor_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} creates={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib when: smart_executor_install notify: Restart smartgears tags: [ 'smartgears', 'smart_executor', 'tomcat' ] - name: Install the smartgears configuration file template: src=smart_executor-container.xml.j2 dest={{ smartgears_install_path }}/container.xml owner={{ item.user }} group={{ item.user }} with_items: '{{ tomcat_m_instances }}' notify: Restart smartgears when: smart_executor_install register: smartexec_containerxml_state tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ] - name: Remove the smartgears application state if the configuration changed file: dest={{ smartgears_install_path }}/state state=absent notify: Restart smartgears when: ( smartexec_containerxml_state | changed ) tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ]