64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
- name: Création du groupe tomcat
|
|
group:
|
|
name: tomcat
|
|
|
|
- name: Création d'un utilisateur Tomcat
|
|
user:
|
|
name: tomcat
|
|
group: tomcat
|
|
home: /usr/share/tomcat
|
|
createhome: no
|
|
system: yes
|
|
|
|
- name: Téléchargement Tomcat
|
|
get_url:
|
|
url: http://10.121.38.10/store/apache-tomcat-10.0.13.tar.gz
|
|
dest: /tmp/apache-tomcat-10.0.13.tar.gz
|
|
|
|
- name: Création d'un répertoire Tomcat
|
|
file:
|
|
path: /usr/share/tomcat
|
|
state: directory
|
|
owner: tomcat
|
|
group: tomcat
|
|
|
|
- name: Extraction de l'archive Tomcat
|
|
unarchive:
|
|
src: /tmp/apache-tomcat-10.0.13.tar.gz
|
|
dest: /usr/share/tomcat
|
|
owner: tomcat
|
|
group: tomcat
|
|
remote_src: yes
|
|
extra_opts: "--strip-components=1"
|
|
creates: /usr/share/tomcat/bin
|
|
|
|
- name: Copie du fichier de défénition de service Tomcat
|
|
template:
|
|
src: templates/tomcat.service.j2
|
|
dest: /etc/systemd/system/tomcat.service
|
|
when: ansible_service_mgr == "systemd"
|
|
|
|
- name: Démarrer Tomcat
|
|
service:
|
|
daemon_reload: yes
|
|
name: tomcat
|
|
state: started
|
|
enabled: yes
|
|
when: ansible_service_mgr == "systemd"
|
|
|
|
- name: Défénition des utilisateurs
|
|
template:
|
|
src: tomcat-users.xml.j2
|
|
dest: /usr/share/tomcat/conf/tomcat-users.xml
|
|
notify: restart tomcat
|
|
|
|
- name: Autoisation des différents ip de connexion
|
|
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
|
|
|