Ansible Workflow
- Make a list of all the commands/steps for deploying the applciation
- Execute them manually.
- Write a Ansible Playbook with the task for each command/step.
Sample-Application
Spring-pet Clinic
- This application is based out of java spring framework
- Prereqs:
- Java 8 should be installed.
- Download the Spring-petclinic.jar file file from here
- once application is downloaded execute the following command in the terminal
java -jar <path to spring-petclinic.jar>
Manual Steps
- Deploy Spring Pet Clinic which by default runs on 8080 port
sudo apt-get update
sudo apt-cache search jdk | less
sudo apt-get install openjdk-8-jdk -y
java -version
wget https://qt-s3-new-testing.s3-us-west-2.amazonaws.com/spring-petclinic.jar
java -jar spring-petclinic.jar
Student Courses Application
- This is application written in Python Flask
- Prereqs:
- Steps
sudo apt-get update
sudo apt-get install python3 python3-pip git -y
git clone https://github.com/DevProjectsForDevOps/StudentCoursesRestAPI.git
cd StudentCoursesRestAPI
pip3 install -r requirements
python3 app.py
Using Ansible For deployment of Sample Application
- This can be done by writing Playbooks.
- To Write effective Playbooks, we need to know
- YAML
- Modules
- Tasks
- Ansible-ENvironment Variables
- Inventory
- Ansible Configuration
YAML
- Is much like JSON.
- It is collection of name value pairs
- Refer here for YAML Syntax
Like this:
Like Loading...