Tuesday, December 27, 2022

Ansible playbook for Tomcat Installation on Ubuntu 18.0.4/20.0.4 | Ansible Tomcat Playbook on Ubuntu 18.0.4/20.0.4

Ansible Playbook for installing Tomcat 9 on Ubuntu 18.0.4

sudo vi installTomcat.yml
---
- hosts: My_Group
  tasks:
    - name: Task # 1 Update APT package manager repositories cache
      become: true
      apt:
        update_cache: yes
    - name: Task # 2 - Install Tomcat using Ansible
      become: yes
      apt:
        name: "{{ packages }}"
        state: present
      vars:
        packages:
           - tomcat9
           - tomcat9-examples
           - tomcat9-docs

sudo ansible-playbook installTomcat.yml
This is the execution result of Ansible playbook.


Now access Tomcat on port 8080 in the target machine where you have installed it.



No comments:

Post a Comment