About | Features | Technologies | Requirements | Starting | License | Author
This script is designed to automate the deployment of Apache Tomcat on an AWS EC2 instance using Ansible. It allows you to choose the version of Tomcat to install, specify user credentials, and assign roles for Tomcat management. This README provides an overview of how to use the script and its functionality.
✔️ Dynamic Tomcat Version Selection:
The script fetches the latest Tomcat version from the Apache Tomcat website. Allows the user to specify the Tomcat version they want to install or uses the default version.
✔️ User Interaction:
Prompts the user to input their desired username and password for Tomcat's manager-gui and manager-script roles. Asks the user to specify the desired roles for Tomcat, such as manager-gui, manager-script, etc., separating each role by a comma.
✔️ Version Validation:
Validates the specified Tomcat version by checking its availability on the Apache Tomcat website. If the version is not found, the user is prompted to choose a different version.
✔️ Deployment on AWS EC2:
Utilizes Ansible playbooks (createc2.yaml and deploytomcat.yaml) for deploying on AWS EC2 instances. Disables Ansible's host key checking to prevent SSH connection issues.
✔️ Dynamic Download Link Generation:
Generates the download link for the specified Tomcat version or uses a default link if no specific version is provided. Handles both the case when the specified version is available on the Apache Tomcat website and when using the default version.
✔️ User-Friendly Prompts:
Provides clear prompts and messages during the execution of the script, guiding the user through the deployment process.
✔️ Customization:
Allows users to easily customize the script for their needs, such as modifying Ansible playbooks or adapting the script for different environments
The following tools were used in this project:
Before using this script, make sure you have the following prerequisites:
Linux Environment: This script is designed to run on a Linux environment, specifically using the Bash shell.
Curl: Ensure that Curl is installed on your system, as it is used to retrieve the latest Tomcat version and download the installation package.
Ansible: You must have Ansible installed and configured on your machine. Ansible is used to automate the deployment process.
# Clone this project
$ git clone https://github.com/patgit12/script-ansible-ec2
# Access
$ cd script-ansible-ec2
# Install dependencies
$ pip install boto boto3 botocore ansible
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
$ sudo ./aws/install
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by Patrick O