Activity 5: Install tomcat 10 server contd
- Steps to be done
# download tomcat tar to /tmp
# file path: /tmp/apache-tomcat-10.1.14.tar.gz
sudo tar -xf /tmp/apache-tomcat-${VERSION}.tar.gz -C /opt/tomcat/
# extract tar file to /opt/tomcat
sudo ln -s /opt/tomcat/apache-tomcat-${VERSION} /opt/tomcat/latest
# Create a link for /opt/tomcat/apache-tomcat-10.1.14 to /opt/tomcat/latest
sudo chown -R tomcat: /opt/tomcat
# transfer of ownership to tomcat user
sudo sh -c 'chmod +x /opt/tomcat/latest/bin/*.sh'
# Add execute permissions to all scripts in bin directory
- Refer Here for the changes in playbook to extract tomcat and Refer Here for the changes done to combine download and extract
- Refer Here for the changes to add symlink
- In Ansible we have modules such as command and shell which execute low level linux commands and are not idempotent. It is our job to make them idempotent
- Lets use this in a raw way (no idempotency) Refer Here
- ansible register variables: Refer Here
- Refer Here for the steps to register a varible with module output and print it
- Refer Here for adding loop to iterate over each file
- Refer Here for changing file permissions iteratively for sh files.
- Exercise: Try redoing same steps on redhat.
