DevOps Classroom notes 28/Feb/2024

Activity 4: Installing tomcat on ubuntu

sudo apt update
sudo apt install openjdk-11-jdk -y
sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat
cd /tmp/
wget https://archive.apache.org/dist/tomcat/tomcat-10/v10.0.10/bin/apache-tomcat-10.0.10.tar.gz
  • The command sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat means create a user tomcat with
    • home directory in /opt/tomcat
    • tomcat as a system user
    • ensure there is group called as tomcat
    • shell is /bin/false
  • Refer Here for the playbook to automate the above steps and execute the playbook
  • Refer Here for debug messages added.
  • Next set of steps
sudo tar xzf apache-tomcat-*.tar.gz -C /opt/tomcat 
  • Refer Here for the changes done to extract tomcat and Refer Here for the remote src to yes for downloading from external sources

Exercise:

  • Make changes in the above playbook to work on centos 8
  • Ensure /opt/tomcat/apache-tomcat-10.0.10 has tomcat user and tomcat group as owner.

References

  • Understanding previlege escalation i.e. using become Refer Here
  • printing messages during execution of playbook is considered to be a good ractice. we can use debug module Refer Here
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%