- name: S'assurer que le système utilise le port HTTPS pour APT. stat: path: /usr/lib/apt/methods/https register: apt_https_transport - name: Installation APT HTTPS transport. apt: name: "apt-transport-https" state: present update_cache: yes when: not apt_https_transport.stat.exists - name: Installation packages basique package: name: ['vim','aptitude','bash-completion','tmux','tree','htop','wget','unzip','curl','git','python'] state: present update_cache: yes - name: Installation Java (Debian/Ubuntu) apt: name: default-jdk state: present - name: Ajout tomcat dans un groupe group: name: tomcat - name: Ajout "tomcat" au user user: name: tomcat group: tomcat home: /usr/share/tomcat createhome: no system: yes - name: Installation Tomcat get_url: url: "https://dlcdn.apache.org/tomcat/tomcat-10/v10.0.14/bin/apache-tomcat-10.0.14.tar.gz" dest: "{{ tomcat_archive_dest }}" - name: Création du répertoire tomcat file: path: /usr/share/tomcat state: directory owner: tomcat group: tomcat - name: Extraction archive de tomcat unarchive: src: "{{ tomcat_archive_dest }}" dest: /usr/share/tomcat owner: tomcat group: tomcat remote_src: yes extra_opts: "--strip-components=1" creates: /usr/share/tomcat/bin - name: Copie tomcat fichier service template: src: templates/tomcat.service.j2 dest: /etc/systemd/system/tomcat.service when: ansible_service_mgr == "systemd" - name: Démarrer et activer tomcat service: daemon_reload: yes name: tomcat state: started enabled: yes when: ansible_service_mgr == "systemd" - name: Définir l'accès a l'interface utilisateur authentifié template: src: tomcat-users.xml.j2 dest: /usr/share/tomcat/conf/tomcat-users.xml notify: restart tomcat - name: Autoriser l'accès aux applications du gestionnaire et gestionnaire d'hote sur n'importe qu'elle IP template: src: context.xml.j2 dest: "{{ item }}" with_items: - /usr/share/tomcat/webapps/host-manager/META-INF/context.xml - /usr/share/tomcat/webapps/manager/META-INF/context.xml notify: restart tomcat - name: "MYSQL - update cache" apt: update_cache: yes - name: "MYSQL - installation" apt: name: mariadb-server state: latest - name: "PYTHON3 - installation" apt: name: python3-pymysql state: latest - name: "MYSQL - démarrage de mysql" service: name: "mysqld" state: started enabled: yes