Making playbook work on redhat 10
sudo dnf update -y
sudo dnf install java-21-openjdk-devel -y
- Rest of the steps are same the service file contents
[Unit]
Description=Apache Tomcat 10
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_BASE=/opt/tomcat"
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
Restart=always
[Install]
WantedBy=multi-user.target
- Refer Here for changes done to create a new playbook for redhat
- Refer Here for changes done to combine both playbooks into one.
Problem: I want to install mongo db
- In Ansible we can make our playbooks reusable and share them within your org or across community.
- This can be acheived with
- ansible roles
- ansible collections
- Ansible galaxy has lots of roles and collections available for use.
Lets install mysql using ansible roles
ansible-galaxy role install geerlingguy.mysql