Git Product home page Git Product logo

rd-ansible-tomcat's Introduction

Role info

Ansible Role to Install Tomcat 9 on CentOS, Fedora, Debian and Ubuntu Linux.

Tested on the following operating systems

  • CentOS 8
  • CentOS 7
  • Fedora 31
  • Ubuntu 18.04
  • Debian 10

Tasks in the role

This role contains tasks to:

  • Install basic packages required
  • Install Java
  • Add tomcat user and group
  • Download tomcat and install - configure systemd
  • Configure firewall

How to use this role

  • Clone the Project:
$ git clone https://github.com/jmutai/tomcat-ansible.git
$ cd tomcat-ansible
  • Update your inventory, e.g:
$ vim hosts
[tomcat-nodes]
192.168.10.10       # Remote user to act on
  • Update variables in playbook file - Set Tomcat version, remote user and Tomcat UI access credentials
$ vim tomcat-setup.yml
- name: Tomcat deployment playbook
  hosts: tomcat-nodes       # 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: 9.0.30                          # Tomcat version to install
    ui_manager_user: manager                    # User who can access the UI manager section only
    ui_manager_pass: Str0ngManagerP@ssw3rd      # UI manager user password
    ui_admin_username: admin                    # User who can access bpth manager and admin UI sections
    ui_admin_pass: Str0ngAdminP@ssw3rd          # UI admin password
  roles:
    - tomcat

If you are using non root remote user, then set username and enable sudo:

become: yes
become_method: sudo

Running Playbook

Once all values are updated, you can then run the playbook against your nodes.

Playbook executed as root user - with ssh key:

$ ansible-playbook -i hosts tomcat-setup.yml

Playbook executed as root user - with password:

$ ansible-playbook -i hosts tomcat-setup.yml --ask-pass

Playbook executed as sudo user - with password:

$ ansible-playbook -i hosts tomcat-setup.yml --ask-pass --ask-become-pass

Playbook executed as sudo user - with ssh key and sudo password:

$ ansible-playbook -i hosts tomcat-setup.yml --ask-become-pass

Playbook executed as sudo user - with ssh key and passwordless sudo:

$ ansible-playbook -i hosts tomcat-setup.yml --ask-become-pass

Execution should be successful without errors:

rd-ansible-tomcat's People

Contributors

jmutai avatar dannymeloy avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.