- name: Install basic packages package: name: ['vim','aptitude','bash-completion','tmux','tree','htop','wget','unzip','curl','git','python'] state: present update_cache: yes - name: installer JDK apt: name: openjdk-11-jdk state: present - name: creer le repertoire /opt/tomcat file: path: /opt/tomcat state: directory mode: 0755 - name: creer le groupe tomcat group: name: tomcat - name: creer l'utilisateur tomcat user: name: tomcat group: tomcat home: /user/share/tomcat createhome: no - name: installer TomCat unarchive: src: http://depl/store/apache-tomcat-10.0.13.tar.gz dest: /opt/tomcat remote_src: yes - name: Change ownership file: path: /opt/tomcat owner: tomcat group: tomcat mode: "u+rwx,g+rx,o=rx" recurse: yes state: directory - name: Templating Tomcat service from local to remote template: src: templates/tomcat.service.j2 dest: /etc/systemd/system/tomcat.service when: ansible_service_mgr == "systemd" - name: Demarrer le service tomcat local_action: command sh /opt/tomcat/apache-tomcat-10.0.13/bin/startup.sh - name: Set UI access credentials template: src: tomcat-users.xml.j2 dest: tomcat-users.xml notify: restart tomcat - name: Allow access to Manager and Host Manager apps from any IP template: src: context.xml.j2 dest: context.xml - name: changement de la ligne dans context.xml replace: path: tomcat-users.xml regexp: replace: - name: Redemarrer le service tomcat (1) local_action: command sh /opt/tomcat/apache-tomcat-10.0.13/bin/shutdown.sh - name: Redemarrer le service tomcat (2) local_action: command sh /opt/tomcat/apache-tomcat-10.0.13/bin/startup.sh