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

101 lines
2.3 KiB
Plaintext

- name: on s'assure que le systeme supporte l'https
stat:
path: /usr/lib/apt/methods/https
register: apt_https_transport
- name: installer apt https transport
apt:
name: "apt-transport-https"
state: present
update_cache: yes
when: not apt_https_transport.stat.exists
- 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: Create a tomcat directory
file:
path: /usr/share/tomcat
state: directory
owner: tomcat
group: tomcat
- name: Extract tomcat archive
unarchive:
src: /opt/tomcat/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: Copy Tomcat service from local to remote
copy:
src: tomcat.service.j2
dest: /etc/systemd/system/
mode: 0755
- name: demarrer le service TomCat
systemd:
name: tomcat
state: started
enabled: true
daemon_reload: yes
- name: Set UI access credentials
template:
src: tomcat-users.xml.j2
dest: /usr/share/tomcat/conf/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:
- /usr/share/tomcat/webapps/host-manager/META-INF/context.xml
- /usr/share/tomcat/webapps/manager/META-INF/context.xml
notify: restart tomcat