--- - name: Manage the javamelody installation block: - set_fact: ansible_python_interpreter: /usr/bin/python3.6 when: ansible_distribution_release == "trusty" - name: Install the javamelody dependency jar into the Java shared libs directory maven_artifact: artifact_id=jrobin version=latest group_id=org.jrobin extension=jar dest=/usr/share/java/jrobin.jar verify_checksum=always mode=0644 owner=root group=root repository_url=https://repo1.maven.org/maven2 - name: Install the javamelody-core jar into the Java shared libs directory maven_artifact: artifact_id=javamelody-core version={{ tomcat_javamelody_version }} group_id=net.bull.javamelody extension=jar dest=/usr/share/java/javamelody-core.jar verify_checksum=always mode=0644 owner=root group=root repository_url=https://repo1.maven.org/maven2 - name: Create a link to the the javamelody jar and its dependencies if the javamelody support is enabled file: src=../../java/{{ item }} dest={{ tomcat_catalina_home_dir }}/lib/{{ item }} state=link owner=root group=root mode=0644 with_items: - javamelody-core.jar - jrobin.jar - set_fact: ansible_python_interpreter: /usr/bin/python when: ansible_distribution_release == "trusty" when: tomcat_javamelody tags: [ 'tomcat', 'tomcat_javamelody', 'tomcat_conf' ] - name: Remove the javamelody jar and its dependencies if the javamelody support is disabled file: dest={{ tomcat_catalina_home_dir }}/lib/{{ item }} state=absent with_items: - javamelody-core.jar - jrobin.jar when: not tomcat_javamelody tags: [ 'tomcat', 'tomcat_javamelody', 'tomcat_conf' ]