From a78a76e312e57c49170b6680bcac6dc6f51071c8 Mon Sep 17 00:00:00 2001 From: uap32-r Date: Mon, 13 Dec 2021 15:41:30 +0100 Subject: [PATCH] ansible tomcat --- SDIS29ansible/ansible/.ppebase.yml.swp | Bin 0 -> 1024 bytes SDIS29ansible/ansible/.test.yml.swp | 0 SDIS29ansible/ansible/hosts | 3 + SDIS29ansible/ansible/invent | 1 + .../ansible/roles/db/handlers/main.yml | 15 ++++ SDIS29ansible/ansible/roles/db/tasks/main.yml | 41 ++++++++++ .../ansible/roles/tomcat/defaults/main.yml | 3 + .../ansible/roles/tomcat/handlers/main.yml | 4 + .../ansible/roles/tomcat/tasks/main.yml | 73 ++++++++++++++++++ .../roles/tomcat/templates/context.xml.j2 | 19 +++++ .../tomcat/templates/tomcat-users.xml.j2 | 44 +++++++++++ .../roles/tomcat/templates/tomcat.service.j2 | 22 ++++++ .../ansible/roles/tomcat/vars/main.yml | 2 + SDIS29ansible/ansible/tomcat-setup.yml | 14 ++++ 14 files changed, 241 insertions(+) create mode 100644 SDIS29ansible/ansible/.ppebase.yml.swp create mode 100644 SDIS29ansible/ansible/.test.yml.swp create mode 100644 SDIS29ansible/ansible/hosts create mode 100644 SDIS29ansible/ansible/invent create mode 100644 SDIS29ansible/ansible/roles/db/handlers/main.yml create mode 100644 SDIS29ansible/ansible/roles/db/tasks/main.yml create mode 100644 SDIS29ansible/ansible/roles/tomcat/defaults/main.yml create mode 100644 SDIS29ansible/ansible/roles/tomcat/handlers/main.yml create mode 100644 SDIS29ansible/ansible/roles/tomcat/tasks/main.yml create mode 100644 SDIS29ansible/ansible/roles/tomcat/templates/context.xml.j2 create mode 100644 SDIS29ansible/ansible/roles/tomcat/templates/tomcat-users.xml.j2 create mode 100644 SDIS29ansible/ansible/roles/tomcat/templates/tomcat.service.j2 create mode 100644 SDIS29ansible/ansible/roles/tomcat/vars/main.yml create mode 100644 SDIS29ansible/ansible/tomcat-setup.yml diff --git a/SDIS29ansible/ansible/.ppebase.yml.swp b/SDIS29ansible/ansible/.ppebase.yml.swp new file mode 100644 index 0000000000000000000000000000000000000000..a263f087f2fba71aa55b7f98820f0fb34d8fbbef GIT binary patch literal 1024 zcmYc?$V<%2S1{ExVL$ + + + diff --git a/SDIS29ansible/ansible/roles/tomcat/templates/tomcat-users.xml.j2 b/SDIS29ansible/ansible/roles/tomcat/templates/tomcat-users.xml.j2 new file mode 100644 index 0000000..dd9bff3 --- /dev/null +++ b/SDIS29ansible/ansible/roles/tomcat/templates/tomcat-users.xml.j2 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + diff --git a/SDIS29ansible/ansible/roles/tomcat/templates/tomcat.service.j2 b/SDIS29ansible/ansible/roles/tomcat/templates/tomcat.service.j2 new file mode 100644 index 0000000..e0d34bd --- /dev/null +++ b/SDIS29ansible/ansible/roles/tomcat/templates/tomcat.service.j2 @@ -0,0 +1,22 @@ +[Unit] +Description=Tomcat +After=syslog.target network.target + +[Service] +Type=forking + +User=tomcat +Group=tomcat + +Environment=JAVA_HOME={{ JAVA_HOME }} +Environment='JAVA_OPTS=-Djava.awt.headless=true' + +Environment=CATALINA_HOME=/usr/share/tomcat +Environment=CATALINA_BASE=/usr/share/tomcat +Environment=CATALINA_PID=/usr/share/tomcat/temp/tomcat.pid + +ExecStart=/usr/share/tomcat/bin/catalina.sh start +ExecStop=/usr/share/tomcat/bin/catalina.sh stop + +[Install] +WantedBy=multi-user.target diff --git a/SDIS29ansible/ansible/roles/tomcat/vars/main.yml b/SDIS29ansible/ansible/roles/tomcat/vars/main.yml new file mode 100644 index 0000000..aae9205 --- /dev/null +++ b/SDIS29ansible/ansible/roles/tomcat/vars/main.yml @@ -0,0 +1,2 @@ +--- +JAVA_HOME: /usr/lib/jvm/default-java diff --git a/SDIS29ansible/ansible/tomcat-setup.yml b/SDIS29ansible/ansible/tomcat-setup.yml new file mode 100644 index 0000000..867b571 --- /dev/null +++ b/SDIS29ansible/ansible/tomcat-setup.yml @@ -0,0 +1,14 @@ +--- +- name: Tomcat deployment playbook + hosts: all # Inventory hosts group / server to act on + become: yes # If to escalate privilege + become_method: sudo # Set become method + remote_user: root # Update username for remote server + vars: + tomcat_ver: 10.0.14 # Tomcat version to install + ui_manager_user: manager # User who can access the UI manager section only + ui_manager_pass: azerty1+ # UI manager user password + ui_admin_username: admin # User who can access bpth manager and admin UI sections + ui_admin_pass: Azerty1+ # UI admin password + roles: + - tomcat