2021-12-14 15:11:34 +01:00

69 lines
1.6 KiB
Plaintext

- 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: tomcat.service.j2
dest: /etc/systemd/system/
mode: 0755
- name: VRRR 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: "{{ item }}"
with_items:
- /opt/tomcat/webapps/host-manager/META-INF/context.xml
- /opt/tomcat/webapps/manager/META-INF/context.xml
notify: restart tomcat