


- ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 UPDATE
- ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 CODE
- ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 DOWNLOAD
Connect to the tomcat web interface and validate - we are using the uri module to connect to the to ensure that the tomcat is started and running fine.Ansible package is not available in the default yum repositories, so we will enable epel repository for CentOS 7 using below commands ~]# yum install epel-release -y Step:2 Install Anisble using yum command ~]# yum install ansible.Enabling the tomcat to Auto-Start - We are enabling the tomcat service we just created, for the boot time auto-start.Ansible has a dedicated module named systemd for to interact with SystemDaemon Reloading SystemD - Once the service file is created and placed on the appropriate /etc/systemd directory, we need to reload the system daemon to sync the changes.we are using |- to maintain the line break while assigning the multiline data to the content variable. another way to do it is to use template but this is convenient. Creating a Service file for tomcat - we are using the copy module to create a file in remote and the content of the service file is hard coded inside the playbook itself.we are basically moving the content from apache-tomcat-**** to /opt/tomcat8 for simplicity using shell module, you can use copy module too it would leave us with a big directory with a clumsy name containing the version etc. Moving files to the right directory - Once the untar is done.

we have combined the efforts of get_url and unarchive together as unarchive can have URL as a source
ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 DOWNLOAD
ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 UPDATE
So make sure you update the Download URL by visiting the Apache tomcat download page I have taken the URL from the tomcat website but it changes often and per region of the world. Let me know if you need any help or face any issues. You can replace it with yum if you are using this playbook for other linux distributions. This ansible-playbook is designed specifically for ubuntu or debian architecture Linux Systems.Īs we are using apt package manager command to install java. name: Connect to Tomcat server on port 8080 and check status 200 - Try 5 times name: Enable the tomcat service and start name: Reload the SystemD to re-read configurations Shell: "mv /opt/tomcat8/apache*/* /opt/tomcat8"Įnvironment="CATALINA_PID=/opt/tomcat8/logs/tomcat.pid"Įnvironment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" name: Move files to the /opt/tomcat8 directory We will decode this Ansible playbook and cover each task in detail shortly.
ANSIBLE PLAYBOOK TO INSTALL TOMCAT ON CENTOS 7 CODE
Here is the source code of the Ansible playbook.
