
- Ansible playbook to install tomcat on centos 7 install#
- 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#
it would leave us with a big directory with a clumsy name containing the version etc.
Ansible playbook to install tomcat on centos 7 download#
Ansible playbook to install tomcat on centos 7 install#
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. Ansible playbook to install Java and TomcatĪnsible playbook to install Java and Tomcat.~]# ansible -m command -a "grep mark /etc/passwd" 'test-servers'Įxample:4 Redirecting the output of command to a file ~]# ansible -m command -a "df -Th" 'test-servers' > /tmp/command-output. Step:5 Now try to run the Commands from Ansible Server.Ĭheck the connectivity of ‘test-servers’ or ansible nodes using ping ~]# ansible -m ping 'test-servers'Įxample :1 Check the uptime of Ansible nodes ~]# ansible -m command -a "uptime" 'test-servers'Įxample:2 Check Kernel Version of nodes ~]# ansible -m command -a "uname -r" 'test-servers'Įxample:3 Adding a user to the nodes ~]# ansible -m command -a "useradd mark" 'test-servers' Step:4 Define the nodes or inventory of servers for Ansible.įile ‘ /etc/ansible/hosts‘ maintains the inventory of servers for Ansible. Use ssh-copy-id command to copy public key of Ansible server to its nodes. Generate keys on the Ansible server and copy public key to the nodes.

Step:3 Setup keys based SSH authentication with Nodes. Once the installation is completed, check the ansible version : ~]# ansible -version 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
