Activity 4: Install tomcat (contd)
- manual step: change permissions for all shell files
sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'
- This can be acheived by command modules Refer Here. But command modules are not idempotent i.e. they execute all the time whenever playbook is executed
- Refer Here for the command module implementation
- Refer Here for registering a variable and using that in next tasks
Verbosity in Ansible
module return values
- Every module has return values and they can be registred Refer Here
loops in ansible
Exercise
- Make the playbook work for centos
- Download tomcat only if the folder /opt/tomcat/apache-tomcat-10.0.10 does not exist.
