diff --git a/5-jenkins/5.2-simple-java-program/HelloWorld.java b/5-jenkins/5.2-simple-java-program/HelloWorld.java
index bbff415..3d090dc 100644
--- a/5-jenkins/5.2-simple-java-program/HelloWorld.java
+++ b/5-jenkins/5.2-simple-java-program/HelloWorld.java
@@ -1,5 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
- System.out.println("Hello, World From Varun Manik on date May 6 2023");
+ System.out.println("Hello, World From Varun Manik on date MaJan 13 2024");
}
}
\ No newline at end of file
diff --git a/5-jenkins/5.3-maven-project/my-app/src/main/java/com/mycompany/app/App.java b/5-jenkins/5.3-maven-project/my-app/src/main/java/com/mycompany/app/App.java
index 32e3060..cff2a1a 100644
--- a/5-jenkins/5.3-maven-project/my-app/src/main/java/com/mycompany/app/App.java
+++ b/5-jenkins/5.3-maven-project/my-app/src/main/java/com/mycompany/app/App.java
@@ -8,6 +8,6 @@ public class App
{
public static void main( String[] args )
{
- System.out.println( "Hello World! From Varun Manik in Simplilearn class" );
+ System.out.println( "Hello World! From Varun Manik in Simplilearn class on date Jan 13 2024" );
}
}
diff --git a/5-jenkins/5.4-ant-java/HelloWorldAnt/build.xml b/5-jenkins/5.4-ant-java/HelloWorldAnt/build.xml
new file mode 100644
index 0000000..cce072a
--- /dev/null
+++ b/5-jenkins/5.4-ant-java/HelloWorldAnt/build.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/5-jenkins/5.4-ant-java/HelloWorldAnt/src/HelloWorld.java b/5-jenkins/5.4-ant-java/HelloWorldAnt/src/HelloWorld.java
new file mode 100644
index 0000000..70fd330
--- /dev/null
+++ b/5-jenkins/5.4-ant-java/HelloWorldAnt/src/HelloWorld.java
@@ -0,0 +1,5 @@
+public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World!");
+ }
+}
diff --git a/5-jenkins/5.4-ant-java/README.md b/5-jenkins/5.4-ant-java/README.md
new file mode 100644
index 0000000..e081579
--- /dev/null
+++ b/5-jenkins/5.4-ant-java/README.md
@@ -0,0 +1,62 @@
+# Hello World Java Program with Ant on Linux.
+
+## Introduction
+This tutorial guides you through creating and running a simple "Hello World" Java program using Apache Ant on a Linux system.
+
+## Prerequisites
+- Java Development Kit (JDK)
+- Apache Ant
+
+Ensure both are installed on your system. You can verify by running `java -version` and `ant -version` in your terminal.
+
+## Setup
+
+### Step 1: Project Structure
+Create a project directory and set up the following structure:
+
+
+
+Navigate to your project directory:
+```bash
+mkdir HelloWorldAnt
+cd HelloWorldAnt
+```
+
+- Step 2: Java Source File
+Inside the src directory, create a file HelloWorld.java:
+
+
+
+```
+public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World!");
+ }
+}
+```
+- Step 3: Ant Build File
+Create build.xml at the root of your project with the following content:
+
+```
+
+
+
+
+
+
+
+
+
+
+
+```
+
+
+- Running the Program
+To build and run your program, execute:
+
+```
+ant run
+```
+
+You should see Hello, World! printed in the console.
diff --git a/5-jenkins/terraform-jenkins-pipeline/Jenkinsfile b/5-jenkins/terraform-jenkins-pipeline/Jenkinsfile
new file mode 100644
index 0000000..0a9d382
--- /dev/null
+++ b/5-jenkins/terraform-jenkins-pipeline/Jenkinsfile
@@ -0,0 +1,35 @@
+pipeline {
+ agent any
+
+ environment {
+ AWS_REGION = 'us-east-1'
+ AWS_ACCESS_KEY_ID = ""
+ AWS_SECRET_ACCESS_KEY = ""
+ }
+
+ stages {
+ stage('Checkout') {
+ steps {
+ checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/vijeshnair89/terraform-jenkins-pipeline.git']])
+ }
+ }
+
+ stage('Terraform Init') {
+ steps {
+ sh 'terraform init'
+ }
+ }
+
+ stage('Terraform Plan') {
+ steps {
+ sh 'terraform plan'
+ }
+ }
+
+ stage('Terraform Apply') {
+ steps {
+ sh 'terraform apply -auto-approve'
+ }
+ }
+ }
+}
diff --git a/5-jenkins/terraform-jenkins-pipeline/main.tf b/5-jenkins/terraform-jenkins-pipeline/main.tf
new file mode 100644
index 0000000..553af60
--- /dev/null
+++ b/5-jenkins/terraform-jenkins-pipeline/main.tf
@@ -0,0 +1,8 @@
+resource "aws_instance" "public_instance" {
+ ami = var.ami
+ instance_type = var.instance_type
+
+ tags = {
+ Name = var.name_tag,
+ }
+}
\ No newline at end of file
diff --git a/5-jenkins/terraform-jenkins-pipeline/output.tf b/5-jenkins/terraform-jenkins-pipeline/output.tf
new file mode 100644
index 0000000..5d746db
--- /dev/null
+++ b/5-jenkins/terraform-jenkins-pipeline/output.tf
@@ -0,0 +1,9 @@
+output "public_ip" {
+ value = aws_instance.public_instance.public_ip
+ description = "Public IP Address of EC2 instance"
+}
+
+output "instance_id" {
+ value = aws_instance.public_instance.id
+ description = "Instance ID"
+}
\ No newline at end of file
diff --git a/5-jenkins/terraform-jenkins-pipeline/provider.tf b/5-jenkins/terraform-jenkins-pipeline/provider.tf
new file mode 100644
index 0000000..b21d3b6
--- /dev/null
+++ b/5-jenkins/terraform-jenkins-pipeline/provider.tf
@@ -0,0 +1 @@
+provider "aws" {}
diff --git a/5-jenkins/terraform-jenkins-pipeline/variables.tf b/5-jenkins/terraform-jenkins-pipeline/variables.tf
new file mode 100644
index 0000000..84d2520
--- /dev/null
+++ b/5-jenkins/terraform-jenkins-pipeline/variables.tf
@@ -0,0 +1,17 @@
+variable "ami" {
+ type = string
+ description = "Ubuntu AMI ID"
+ default = "ami-03f4878755434977f"
+}
+
+variable "instance_type" {
+ type = string
+ description = "Instance type"
+ default = "t2.micro"
+}
+
+variable "name_tag" {
+ type = string
+ description = "Name of the EC2 instance"
+ default = "Terraform"
+}
diff --git a/6-ansible/6.2-node-ansible-playbook/README.md b/6-ansible-terraform/6.2-node-ansible-playbook/README.md
similarity index 100%
rename from 6-ansible/6.2-node-ansible-playbook/README.md
rename to 6-ansible-terraform/6.2-node-ansible-playbook/README.md
diff --git a/6-ansible/6.2-node-ansible-playbook/node.yml b/6-ansible-terraform/6.2-node-ansible-playbook/node.yml
similarity index 100%
rename from 6-ansible/6.2-node-ansible-playbook/node.yml
rename to 6-ansible-terraform/6.2-node-ansible-playbook/node.yml
diff --git a/6-ansible/6.3-apache-ansible-playbook/apache.yaml b/6-ansible-terraform/6.3-apache-ansible-playbook/apache.yaml
similarity index 100%
rename from 6-ansible/6.3-apache-ansible-playbook/apache.yaml
rename to 6-ansible-terraform/6.3-apache-ansible-playbook/apache.yaml
diff --git a/6-ansible/6.4-ansible-module/README.md b/6-ansible-terraform/6.4-ansible-module/README.md
similarity index 100%
rename from 6-ansible/6.4-ansible-module/README.md
rename to 6-ansible-terraform/6.4-ansible-module/README.md
diff --git a/6-ansible/6.5-ansible-role/README.md b/6-ansible-terraform/6.5-ansible-role/README.md
similarity index 100%
rename from 6-ansible/6.5-ansible-role/README.md
rename to 6-ansible-terraform/6.5-ansible-role/README.md
diff --git a/6-ansible/6.5-ansible-role/ansible.cfg b/6-ansible-terraform/6.5-ansible-role/ansible.cfg
similarity index 100%
rename from 6-ansible/6.5-ansible-role/ansible.cfg
rename to 6-ansible-terraform/6.5-ansible-role/ansible.cfg
diff --git a/6-ansible/6.5-ansible-role/demor-role.yml b/6-ansible-terraform/6.5-ansible-role/demor-role.yml
similarity index 78%
rename from 6-ansible/6.5-ansible-role/demor-role.yml
rename to 6-ansible-terraform/6.5-ansible-role/demor-role.yml
index 78bb297..b42b276 100644
--- a/6-ansible/6.5-ansible-role/demor-role.yml
+++ b/6-ansible-terraform/6.5-ansible-role/demor-role.yml
@@ -2,8 +2,8 @@
---
- name: use demor role playbook
- hosts: my_server
- user: ansible
+ hosts: localhost
+ user: ubuntu
become: true
roles:
diff --git a/6-ansible/6.5-ansible-role/demor/.travis.yml b/6-ansible-terraform/6.5-ansible-role/demor/.travis.yml
similarity index 100%
rename from 6-ansible/6.5-ansible-role/demor/.travis.yml
rename to 6-ansible-terraform/6.5-ansible-role/demor/.travis.yml
diff --git a/6-ansible/6.5-ansible-role/demor/README.md b/6-ansible-terraform/6.5-ansible-role/demor/README.md
similarity index 100%
rename from 6-ansible/6.5-ansible-role/demor/README.md
rename to 6-ansible-terraform/6.5-ansible-role/demor/README.md
diff --git a/6-ansible/6.5-ansible-role/demor/defaults/main.yml b/6-ansible-terraform/6.5-ansible-role/demor/defaults/main.yml
similarity index 100%
rename from 6-ansible/6.5-ansible-role/demor/defaults/main.yml
rename to 6-ansible-terraform/6.5-ansible-role/demor/defaults/main.yml
diff --git a/6-ansible/6.5-ansible-role/demor/meta/main.yml b/6-ansible-terraform/6.5-ansible-role/demor/meta/main.yml
similarity index 96%
rename from 6-ansible/6.5-ansible-role/demor/meta/main.yml
rename to 6-ansible-terraform/6.5-ansible-role/demor/meta/main.yml
index c572acc..0dbdfb9 100644
--- a/6-ansible/6.5-ansible-role/demor/meta/main.yml
+++ b/6-ansible-terraform/6.5-ansible-role/demor/meta/main.yml
@@ -1,6 +1,6 @@
galaxy_info:
- author: your name
- description: your role description
+ author: Varun
+ description: Cloud Engineer
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
diff --git a/6-ansible/6.5-ansible-role/demor/tasks/main.yml b/6-ansible-terraform/6.5-ansible-role/demor/tasks/main.yml
similarity index 100%
rename from 6-ansible/6.5-ansible-role/demor/tasks/main.yml
rename to 6-ansible-terraform/6.5-ansible-role/demor/tasks/main.yml
diff --git a/6-ansible/6.5-ansible-role/demor/templates/demor.j2 b/6-ansible-terraform/6.5-ansible-role/demor/templates/demor.j2
similarity index 100%
rename from 6-ansible/6.5-ansible-role/demor/templates/demor.j2
rename to 6-ansible-terraform/6.5-ansible-role/demor/templates/demor.j2
diff --git a/6-ansible/6.5-ansible-role/deployer b/6-ansible-terraform/6.5-ansible-role/deployer
similarity index 100%
rename from 6-ansible/6.5-ansible-role/deployer
rename to 6-ansible-terraform/6.5-ansible-role/deployer
diff --git a/6-ansible/6.5-ansible-role/deployer.pub b/6-ansible-terraform/6.5-ansible-role/deployer.pub
similarity index 100%
rename from 6-ansible/6.5-ansible-role/deployer.pub
rename to 6-ansible-terraform/6.5-ansible-role/deployer.pub
diff --git a/6-ansible/6.5-ansible-role/host_vars.yml b/6-ansible-terraform/6.5-ansible-role/host_vars.yml
similarity index 100%
rename from 6-ansible/6.5-ansible-role/host_vars.yml
rename to 6-ansible-terraform/6.5-ansible-role/host_vars.yml
diff --git a/6-ansible-terraform/6.5-ansible-role/inventory.ini b/6-ansible-terraform/6.5-ansible-role/inventory.ini
new file mode 100644
index 0000000..4dbc68f
--- /dev/null
+++ b/6-ansible-terraform/6.5-ansible-role/inventory.ini
@@ -0,0 +1,3 @@
+[my_servers]
+my_server ansible_host=localhost
+# my_server ansible_host=54.224.173.170
diff --git a/6-ansible/6.6-setup-terraform/README.md b/6-ansible-terraform/6.6-setup-terraform/README.md
similarity index 100%
rename from 6-ansible/6.6-setup-terraform/README.md
rename to 6-ansible-terraform/6.6-setup-terraform/README.md
diff --git a/6-ansible/6.6-setup-terraform/tf-installation.sh b/6-ansible-terraform/6.6-setup-terraform/tf-installation.sh
similarity index 100%
rename from 6-ansible/6.6-setup-terraform/tf-installation.sh
rename to 6-ansible-terraform/6.6-setup-terraform/tf-installation.sh
diff --git a/6-ansible-terraform/6.6.1-tf-local-file/.terraform.lock.hcl b/6-ansible-terraform/6.6.1-tf-local-file/.terraform.lock.hcl
new file mode 100644
index 0000000..62da99d
--- /dev/null
+++ b/6-ansible-terraform/6.6.1-tf-local-file/.terraform.lock.hcl
@@ -0,0 +1,21 @@
+# This file is maintained automatically by "terraform init".
+# Manual edits may be lost in future updates.
+
+provider "registry.terraform.io/hashicorp/local" {
+ version = "2.4.1"
+ hashes = [
+ "h1:FzraUapGrJoH3ZOWiUT2m6QpZAD+HmU+JmqZgM4/o2Y=",
+ "zh:244b445bf34ddbd167731cc6c6b95bbed231dc4493f8cc34bd6850cfe1f78528",
+ "zh:3c330bdb626123228a0d1b1daa6c741b4d5d484ab1c7ae5d2f48d4c9885cc5e9",
+ "zh:5ff5f9b791ddd7557e815449173f2db38d338e674d2d91800ac6e6d808de1d1d",
+ "zh:70206147104f4bf26ae67d730c995772f85bf23e28c2c2e7612c74f4dae3c46f",
+ "zh:75029676993accd6bef933c196b2fad51a9ec8a69a847dbbe96ec8ebf7926cdc",
+ "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
+ "zh:7d48d5999fe1fcdae9295a7c3448ac1541f5a24c474bd82df6d4fa3732483f2b",
+ "zh:b766b38b027f0f84028244d1c2f990431a37d4fc3ac645962924554016507e77",
+ "zh:bfc7ad301dada204cf51c59d8bd6a9a87de5fddb42190b4d6ba157d6e08a1f10",
+ "zh:c902b527702a8c5e2c25a6637d07bbb1690cb6c1e63917a5f6dc460efd18d43f",
+ "zh:d68ae0e1070cf429c46586bc87580c3ed113f76241da2b6e4f1a8348126b3c46",
+ "zh:f4903fd89f7c92a346ae9e666c2d0b6884c4474ae109e9b4bd15e7efaa4bfc29",
+ ]
+}
diff --git a/6-ansible-terraform/6.6.1-tf-local-file/index.html b/6-ansible-terraform/6.6.1-tf-local-file/index.html
new file mode 100755
index 0000000..f077469
--- /dev/null
+++ b/6-ansible-terraform/6.6.1-tf-local-file/index.html
@@ -0,0 +1 @@
+Hi How are you ?
\ No newline at end of file
diff --git a/6-ansible-terraform/6.6.1-tf-local-file/main.tf b/6-ansible-terraform/6.6.1-tf-local-file/main.tf
new file mode 100644
index 0000000..5c53112
--- /dev/null
+++ b/6-ansible-terraform/6.6.1-tf-local-file/main.tf
@@ -0,0 +1,7 @@
+resource "local_file" "index_file" {
+
+ content = "Hi How are you ?"
+
+ filename = "index.html"
+
+}
diff --git a/6-ansible/6.7-S3-Bucket-Using-Terraform/.gitignore b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/.gitignore
similarity index 100%
rename from 6-ansible/6.7-S3-Bucket-Using-Terraform/.gitignore
rename to 6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/.gitignore
diff --git a/6-ansible/6.7-S3-Bucket-Using-Terraform/.terraform.lock.hcl b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/.terraform.lock.hcl
similarity index 100%
rename from 6-ansible/6.7-S3-Bucket-Using-Terraform/.terraform.lock.hcl
rename to 6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/.terraform.lock.hcl
diff --git a/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/README.md b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/README.md
new file mode 100644
index 0000000..17a0124
--- /dev/null
+++ b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/README.md
@@ -0,0 +1,167 @@
+# Lesson 06 Demo 7 - Create an S3 Bucket Using Terraform
+
+This document provides the steps to create an S3 bucket using Terraform.
+
+## Steps to be performed
+
+1. Set up Terraform components
+2. Create Terraform execution plan
+
+## Step 1: Set up Terraform components
+
+1.1 Run the following commands in the given sequence to set up the Terraform component:
+
+```
+pip install awscli
+sudo apt-get update
+```
+
+1.2 Create a new file to execute this project.
+
+
+
+```
+
+mkdir s3back
+cd s3back
+```
+
+## Step 2: Create a Terraform execution plan
+2.1 Create creds.tf under s3back and add the following code:
+
+
+
+```
+
+nano creds.tf
+```
+
+2.2 Paste the following code:
+
+
+```
+
+
+provider "aws" {
+ access_key = ""
+ secret_key = ""
+ token = ""
+ region = "us-east-1"
+}
+```
+
+Note: Use the AWS access credentials provided in the AWS API Access tab in your LMS in your PRACTICE LAB tab as shown in the screenshot.
+
+2.3 Create main.tf under s3back and run the following code:
+
+
+
+```
+
+nano main.tf
+```
+
+2.4 Paste the following code:
+
+
+
+```
+
+resource "aws_s3_bucket" "b" {
+ bucket = "my-tf-test-bucket"
+ acl = "private"
+
+ tags = {
+ Name = "My bucket"
+ Environment = "Dev"
+ }
+}
+
+```
+
+Note: Bucket name (here my-tf-test-bucket) entered here should be unique globally otherwise it may throw an error while executing the script.
+
+2.5 Run the following commands in the given sequence to add the AWS providers:
+
+
+
+```
+
+terraform init
+```
+
+2.6 Run the following command to commit TF state:
+
+
+
+```
+
+terraform plan
+```
+
+2.7 Run the following command to create the S3 bucket:
+
+
+
+```
+
+terraform apply
+```
+
+**Enter a value: Yes**
+
+2.8 Verify the creation of S3 bucket in the AWS Management console.
+
+
+---
+
+# Creating and Using Secret Access Keys and Access IDs in AWS IAM for Linux VMs
+
+## Steps
+
+1. **Create an IAM User:**
+ - Access the AWS Management Console and navigate to IAM.
+ - Click "Users" -> "Add user."
+ - Assign a meaningful username and select "Programmatic access."
+ - Click "Next: Permissions."
+
+2. **Attach Permissions:**
+ - Choose an existing policy or create a custom one, granting only necessary permissions.
+ - Click "Next: Tags."
+ - Optionally add tags.
+ - Click "Next: Review."
+ - Verify details and click "Create user."
+
+3. **Securely Store Access Key and ID:**
+ - Immediately download and securely store the secret access key (not retrievable later).
+ - Note the access key ID.
+
+4. **Add Credentials to Linux VM:**
+ - Choose a secure storage method:
+
+ - **Environment variables (temporary):**
+ ```bash
+ export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
+ export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
+ ```
+
+ - **AWS CLI configuration file:**
+ Create `~/.aws/credentials`:
+ ```
+ [default]
+ aws_access_key_id = YOUR_ACCESS_KEY_ID
+ aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
+
+
+ - **AWS SDK environment variables:**
+ Set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` for applications using the SDK.
+
+## Security Best Practices
+
+- **Avoid hardcoding access keys:** Use AWS Secrets Manager or similar for secure storage and rotation.
+- **Regularly rotate access keys:** Enhance security.
+- **Use strong passwords for IAM users:** Strengthen protection.
+- **Enable MFA:** Add a layer of security.
+- **Implement AWS CloudTrail:** Log API activity for auditing and analysis.
+- **Regularly review and update permissions:** Maintain least privilege.
+
diff --git a/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/creds.tf b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/creds.tf
new file mode 100644
index 0000000..9b3bfe6
--- /dev/null
+++ b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/creds.tf
@@ -0,0 +1,6 @@
+provider "aws" {
+ access_key = ""
+ secret_key = ""
+ token = ""
+ region = "us-east-1"
+}
\ No newline at end of file
diff --git a/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/main.tf b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/main.tf
new file mode 100644
index 0000000..74a335d
--- /dev/null
+++ b/6-ansible-terraform/6.7-S3-Bucket-Using-Terraform/main.tf
@@ -0,0 +1,10 @@
+
+resource "aws_s3_bucket" "bucket" {
+ bucket = "varun-tf-test-bucket-0acb9876"
+ acl = "private"
+
+ tags = {
+ Name = "My bucket"
+ Environment = "Dev"
+ }
+}
diff --git a/6-ansible/6.8-tf-ec2-provisioning/.gitignore b/6-ansible-terraform/6.8-tf-ec2-provisioning/.gitignore
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/.gitignore
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/.gitignore
diff --git a/6-ansible/6.8-tf-ec2-provisioning/.terraform.lock.hcl b/6-ansible-terraform/6.8-tf-ec2-provisioning/.terraform.lock.hcl
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/.terraform.lock.hcl
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/.terraform.lock.hcl
diff --git a/6-ansible/6.8-tf-ec2-provisioning/README.md b/6-ansible-terraform/6.8-tf-ec2-provisioning/README.md
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/README.md
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/README.md
diff --git a/6-ansible/6.8-tf-ec2-provisioning/amazon-linux-vm.tf b/6-ansible-terraform/6.8-tf-ec2-provisioning/amazon-linux-vm.tf
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/amazon-linux-vm.tf
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/amazon-linux-vm.tf
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/README.md b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/README.md
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/README.md
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/README.md
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/ansible.cfg b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ansible.cfg
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/ansible.cfg
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ansible.cfg
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/apache.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/apache.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/apache.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/apache.yaml
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/host_vars.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/host_vars.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/host_vars.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/host_vars.yaml
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/inventory copy.ini-backup b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory copy.ini-backup
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/inventory copy.ini-backup
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory copy.ini-backup
diff --git a/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory.ini b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory.ini
new file mode 100644
index 0000000..2f2a14f
--- /dev/null
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory.ini
@@ -0,0 +1,29 @@
+
+[ubuntu_vm]
+my_server_1 ansible_host=54.224.173.170
+my_server_2 ansible_host=54.166.216.181
+my_server_3 ansible_host=50.16.161.255
+
+
+[ubuntu:children]
+ubuntu_vm
+
+[ubuntu:vars]
+ansible_user=ubuntu
+ansible_ssh_private_key_file=../deployer
+
+
+
+[aws_linux_vm]
+# aws_linux ansible_host=54.210.170.163
+aws_linux ansible_host=54.161.95.81
+# aws_linux ansible_host=34.207.226.250
+
+
+
+[aws:children]
+aws_linux_vm
+
+[aws:vars]
+ansible_user=ec2-user
+ansible_ssh_private_key_file=../deployer
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/inventory.ini b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory.ini.org
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/inventory.ini
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/inventory.ini.org
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/jenkins.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/jenkins.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/jenkins.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/jenkins.yaml
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/node.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/node.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/node.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/node.yaml
diff --git a/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_1 b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_1
new file mode 100644
index 0000000..f2c413c
--- /dev/null
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_1
@@ -0,0 +1 @@
+{"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": true, "cmd": "apt update -y", "delta": "0:00:02.166809", "end": "2024-01-20 07:28:54.068907", "msg": "", "rc": 0, "start": "2024-01-20 07:28:51.902098", "stderr": "\nWARNING: apt does not have a stable CLI interface. Use with caution in scripts.", "stderr_lines": ["", "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."], "stdout": "Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease\nHit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease\nHit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease\nHit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease\nReading package lists...\nBuilding dependency tree...\nReading state information...\n168 packages can be upgraded. Run 'apt list --upgradable' to see them.", "stdout_lines": ["Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease", "Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease", "Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease", "Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease", "Reading package lists...", "Building dependency tree...", "Reading state information...", "168 packages can be upgraded. Run 'apt list --upgradable' to see them."]}
\ No newline at end of file
diff --git a/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_2 b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_2
new file mode 100644
index 0000000..46b4678
--- /dev/null
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_2
@@ -0,0 +1 @@
+{"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": true, "cmd": "apt update -y", "delta": "0:00:02.238591", "end": "2024-01-20 07:28:54.160319", "msg": "", "rc": 0, "start": "2024-01-20 07:28:51.921728", "stderr": "\nWARNING: apt does not have a stable CLI interface. Use with caution in scripts.", "stderr_lines": ["", "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."], "stdout": "Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease\nHit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease\nHit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease\nHit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease\nReading package lists...\nBuilding dependency tree...\nReading state information...\n168 packages can be upgraded. Run 'apt list --upgradable' to see them.", "stdout_lines": ["Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease", "Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease", "Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease", "Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease", "Reading package lists...", "Building dependency tree...", "Reading state information...", "168 packages can be upgraded. Run 'apt list --upgradable' to see them."]}
\ No newline at end of file
diff --git a/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_3 b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_3
new file mode 100644
index 0000000..fbf4eae
--- /dev/null
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/rue/my_server_3
@@ -0,0 +1 @@
+{"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": true, "cmd": "apt update -y", "delta": "0:00:02.234414", "end": "2024-01-20 07:28:54.111227", "msg": "", "rc": 0, "start": "2024-01-20 07:28:51.876813", "stderr": "\nWARNING: apt does not have a stable CLI interface. Use with caution in scripts.", "stderr_lines": ["", "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."], "stdout": "Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease\nHit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease\nHit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease\nHit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease\nReading package lists...\nBuilding dependency tree...\nReading state information...\n168 packages can be upgraded. Run 'apt list --upgradable' to see them.", "stdout_lines": ["Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease", "Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease", "Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease", "Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease", "Reading package lists...", "Building dependency tree...", "Reading state information...", "168 packages can be upgraded. Run 'apt list --upgradable' to see them."]}
\ No newline at end of file
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-1.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-1.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-1.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-1.yaml
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-config.php.j2 b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-config.php.j2
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-config.php.j2
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/ubuntu-wp-config.php.j2
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/wp-config.php.j2 b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/wp-config.php.j2
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/wp-config.php.j2
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/wp-config.php.j2
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/wp.yaml b/6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/wp.yaml
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ansible/wp.yaml
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ansible/wp.yaml
diff --git a/6-ansible-terraform/6.8-tf-ec2-provisioning/creds.tf b/6-ansible-terraform/6.8-tf-ec2-provisioning/creds.tf
new file mode 100644
index 0000000..9d4d164
--- /dev/null
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/creds.tf
@@ -0,0 +1,6 @@
+provider "aws" {
+ access_key = "AKIAQ7ZCMYMXTD7Q2FOK"
+ secret_key = "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"
+ token = ""
+ region = "us-east-1"
+}
\ No newline at end of file
diff --git a/6-ansible/6.8-tf-ec2-provisioning/deployer b/6-ansible-terraform/6.8-tf-ec2-provisioning/deployer
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/deployer
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/deployer
diff --git a/6-ansible/6.8-tf-ec2-provisioning/deployer.ppk b/6-ansible-terraform/6.8-tf-ec2-provisioning/deployer.ppk
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/deployer.ppk
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/deployer.ppk
diff --git a/6-ansible/6.8-tf-ec2-provisioning/deployer.pub b/6-ansible-terraform/6.8-tf-ec2-provisioning/deployer.pub
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/deployer.pub
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/deployer.pub
diff --git a/6-ansible/6.8-tf-ec2-provisioning/main.tf b/6-ansible-terraform/6.8-tf-ec2-provisioning/main.tf
similarity index 70%
rename from 6-ansible/6.8-tf-ec2-provisioning/main.tf
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/main.tf
index a97b619..aa62dda 100644
--- a/6-ansible/6.8-tf-ec2-provisioning/main.tf
+++ b/6-ansible-terraform/6.8-tf-ec2-provisioning/main.tf
@@ -9,7 +9,3 @@ terraform {
required_version = ">= 0.14.9"
}
-provider "aws" {
- profile = "default"
- region = "us-east-1"
-}
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ubuntu-vm.tf b/6-ansible-terraform/6.8-tf-ec2-provisioning/ubuntu-vm.tf
similarity index 100%
rename from 6-ansible/6.8-tf-ec2-provisioning/ubuntu-vm.tf
rename to 6-ansible-terraform/6.8-tf-ec2-provisioning/ubuntu-vm.tf
diff --git a/6-ansible/README.md b/6-ansible-terraform/README.md
similarity index 100%
rename from 6-ansible/README.md
rename to 6-ansible-terraform/README.md
diff --git a/6-ansible-terraform/wordpress/README.md b/6-ansible-terraform/wordpress/README.md
new file mode 100644
index 0000000..0803bd6
--- /dev/null
+++ b/6-ansible-terraform/wordpress/README.md
@@ -0,0 +1,123 @@
+# DevOps-Tutorial
+
+## Goal
+The goal of this project is to provide an example of how to use Ansible to setup a WordPress site on an AWS EC2 instance running Amazon Linux 2.
+
+## Features
+- This Ansible playbook will install all necessary dependencies including Python, PHP, Apache, and MariaDB.
+- It sets up a WordPress database and user.
+- It downloads the latest version of WordPress and configures it to use the database.
+- It updates the WordPress config file using an Ansible template.
+
+## Prerequisites
+- An AWS account with the necessary permissions to create EC2 instances.
+- Ansible installed on your local machine or control node.
+- Basic knowledge of Ansible playbooks.
+
+## Usage
+1. Clone this repository to your local machine or control node: `git clone https://github.com/manikcloud/DevOps-Tutorial.git`
+2. Change into the project directory: `cd DevOps-Tutorial`
+3. Update the `aws_linux_vm` variable in the playbook with the IP address or hostname of your EC2 instance.
+4. Run the playbook: `ansible-playbook playbook.yml`
+
+---
+
+
+# Setting up WordPress on an Amazon Linux Instance
+
+This guide provides a simplified overview of setting up WordPress on an Amazon Linux instance. **It assumes familiarity with the command line and AWS services.**
+
+**## Steps:**
+
+1. **Launch an Amazon Linux EC2 Instance:**
+ - Log into your AWS account.
+ - Launch an Amazon Linux EC2 instance.
+ - Ensure security groups allow HTTP (port 80) and SSH (port 22) access.
+
+2. **Connect to Your Instance:**
+ - Use SSH to connect to your instance:
+ ```bash
+ ssh -i /path/to/your-key.pem ec2-user@your-instance-public-dns
+ ```
+
+3. **Update Your Instance:**
+ - Once connected, update your instance:
+ ```bash
+ sudo yum update -y
+ ```
+
+4. **Install Apache Web Server:**
+ - Install and start Apache:
+ ```bash
+ sudo yum install httpd -y
+ sudo systemctl start httpd.service
+ sudo systemctl enable httpd.service
+ ```
+
+5. **Install MySQL (MariaDB):**
+ - Install the MariaDB server:
+ ```bash
+ sudo yum install mariadb-server mariadb -y
+ sudo systemctl start mariadb
+ sudo mysql_secure_installation
+ sudo systemctl enable mariadb.service
+ ```
+
+6. **Create a WordPress Database and User:**
+ - Log into the MariaDB shell and create a database and user:
+ ```sql
+ mysql -u root -p
+ CREATE DATABASE wordpress;
+ GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
+ FLUSH PRIVILEGES;
+ EXIT;
+ ```
+
+7. **Install PHP:**
+ - Install PHP and necessary extensions:
+ ```bash
+ sudo yum install php php-mysql php-gd php-pear -y
+ sudo systemctl restart httpd.service
+ ```
+
+8. **Download and Install WordPress:**
+ - Download and configure WordPress:
+ ```bash
+ wget [https://wordpress.org/latest.tar.gz](https://wordpress.org/latest.tar.gz)
+ tar -xzf latest.tar.gz
+ sudo rsync -avP ~/wordpress/ /var/www/html/
+ mkdir /var/www/html/wp-content/uploads
+ sudo chown -R apache:apache /var/www/html/*
+ ```
+
+9. **Configure WordPress:**
+ - Navigate to the `/var/www/html` directory.
+ - Rename and edit the WordPress configuration file:
+ ```bash
+ cd /var/www/html
+ mv wp-config-sample.php wp-config.php
+ sudo nano wp-config.php
+ ```
+ - Update the database settings.
+
+10. **Complete Installation Through the Web Interface:**
+ - Access your server's domain or IP address in a web browser.
+ - Complete the WordPress installation through the web interface.
+
+**## Additional Considerations:**
+
+- **HTTPS:** Set up HTTPS for secure communication.
+- **Virtual Hosts:** Configure virtual hosts to manage multiple websites.
+- **Server Optimization:** Optimize server performance for WordPress.
+- **WordPress Security:** Secure your WordPress installation.
+
+
+
+## Conclusion
+This project provides a starting point for automating the setup of WordPress sites using Ansible and AWS. It can be extended or modified to suit your specific needs. This project is for demonstration purposes and should not be used as-is for production environments.
+
+## Contributing
+Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
+
+## License
+[MIT](https://choosealicense.com/licenses/mit/)
diff --git a/6-ansible/wordpress/wp-config.php.j2 b/6-ansible-terraform/wordpress/wp-config.php.j2
similarity index 100%
rename from 6-ansible/wordpress/wp-config.php.j2
rename to 6-ansible-terraform/wordpress/wp-config.php.j2
diff --git a/6-ansible/wordpress/wp.yaml b/6-ansible-terraform/wordpress/wp.yaml
similarity index 100%
rename from 6-ansible/wordpress/wp.yaml
rename to 6-ansible-terraform/wordpress/wp.yaml
diff --git a/6-ansible/6.5-ansible-role/inventory.ini b/6-ansible/6.5-ansible-role/inventory.ini
deleted file mode 100644
index 83727e2..0000000
--- a/6-ansible/6.5-ansible-role/inventory.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[my_servers]
-my_server ansible_host=18.209.59.137
-
-#ansible all -i '18.209.59.137,' --private-key=path/to/deployer -m ping
\ No newline at end of file
diff --git a/6-ansible/6.7-S3-Bucket-Using-Terraform/README.md b/6-ansible/6.7-S3-Bucket-Using-Terraform/README.md
deleted file mode 100644
index bfbace2..0000000
--- a/6-ansible/6.7-S3-Bucket-Using-Terraform/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# Lesson 06 Demo 7 - Create an S3 Bucket Using Terraform
-
-This document provides the steps to create an S3 bucket using Terraform.
-
-## Steps to be performed
-
-1. Set up Terraform components
-2. Create Terraform execution plan
-
-## Step 1: Set up Terraform components
-
-1.1 Run the following commands in the given sequence to set up the Terraform component:
-
-```
-pip install awscli
-sudo apt-get update
-```
-
-1.2 Create a new file to execute this project.
-
-
-
-```
-
-mkdir s3back
-cd s3back
-```
-
-## Step 2: Create a Terraform execution plan
-2.1 Create creds.tf under s3back and add the following code:
-
-
-
-```
-
-nano creds.tf
-```
-
-2.2 Paste the following code:
-
-
-```
-
-
-provider "aws" {
- access_key = ""
- secret_key = ""
- token = ""
- region = "us-east-1"
-}
-```
-
-Note: Use the AWS access credentials provided in the AWS API Access tab in your LMS in your PRACTICE LAB tab as shown in the screenshot.
-
-2.3 Create main.tf under s3back and run the following code:
-
-
-
-```
-
-nano main.tf
-```
-
-2.4 Paste the following code:
-
-
-
-```
-
-resource "aws_s3_bucket" "b" {
- bucket = "my-tf-test-bucket"
- acl = "private"
-
- tags = {
- Name = "My bucket"
- Environment = "Dev"
- }
-}
-
-```
-
-Note: Bucket name (here my-tf-test-bucket) entered here should be unique globally otherwise it may throw an error while executing the script.
-
-2.5 Run the following commands in the given sequence to add the AWS providers:
-
-
-
-```
-
-terraform init
-```
-
-2.6 Run the following command to commit TF state:
-
-
-
-```
-
-terraform plan
-```
-
-2.7 Run the following command to create the S3 bucket:
-
-
-
-```
-
-terraform apply
-```
-
-**Enter a value: Yes**
-
-2.8 Verify the creation of S3 bucket in the AWS Management console.
-
-
diff --git a/6-ansible/6.7-S3-Bucket-Using-Terraform/main.tf b/6-ansible/6.7-S3-Bucket-Using-Terraform/main.tf
deleted file mode 100644
index 84b4269..0000000
--- a/6-ansible/6.7-S3-Bucket-Using-Terraform/main.tf
+++ /dev/null
@@ -1,13 +0,0 @@
-provider "aws" {
-
- region = "us-east-1"
-}
-resource "aws_s3_bucket" "b" {
- bucket = "my-tf-test-bucket-345611"
- acl = "private"
-
- tags = {
- Name = "My bucket"
- Environment = "Dev"
- }
-}
diff --git a/6-ansible/6.8-tf-ec2-provisioning/ansible/ping.yaml b/6-ansible/6.8-tf-ec2-provisioning/ansible/ping.yaml
deleted file mode 100644
index 52c7a72..0000000
--- a/6-ansible/6.8-tf-ec2-provisioning/ansible/ping.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-
-- name: This is a simple Playbook.
- hosts: my_servers
- become: yes
- gather_facts: yes
-
- tasks:
- - name: 1. Ping the remote server
- ping:
- - name: 2. Create index file
- file:
- path: /home/ubuntu/index.html
- state: touch
-
- - name: 3. Apache2
- apt:
- name: apache2
- state: present
-
-
- - name: 4. Apache2-service
- service:
- name: apache2
- state: restarted
-
- # # - name: 2. Un-Install git
- # # apt:
- # # name: git
- # # state: present
-
-
-
\ No newline at end of file
diff --git a/6-ansible/wordpress/README.md b/6-ansible/wordpress/README.md
deleted file mode 100644
index ce902c9..0000000
--- a/6-ansible/wordpress/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# DevOps-Tutorial
-
-## Goal
-The goal of this project is to provide an example of how to use Ansible to setup a WordPress site on an AWS EC2 instance running Amazon Linux 2.
-
-## Features
-- This Ansible playbook will install all necessary dependencies including Python, PHP, Apache, and MariaDB.
-- It sets up a WordPress database and user.
-- It downloads the latest version of WordPress and configures it to use the database.
-- It updates the WordPress config file using an Ansible template.
-
-## Prerequisites
-- An AWS account with the necessary permissions to create EC2 instances.
-- Ansible installed on your local machine or control node.
-- Basic knowledge of Ansible playbooks.
-
-## Usage
-1. Clone this repository to your local machine or control node: `git clone https://github.com/manikcloud/DevOps-Tutorial.git`
-2. Change into the project directory: `cd DevOps-Tutorial`
-3. Update the `aws_linux_vm` variable in the playbook with the IP address or hostname of your EC2 instance.
-4. Run the playbook: `ansible-playbook playbook.yml`
-
-## Conclusion
-This project provides a starting point for automating the setup of WordPress sites using Ansible and AWS. It can be extended or modified to suit your specific needs. This project is for demonstration purposes and should not be used as-is for production environments.
-
-## Contributing
-Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
-
-## License
-[MIT](https://choosealicense.com/licenses/mit/)
diff --git a/7-docker/Dockerfile b/7-docker/Dockerfile
index 3331d7b..b4723a1 100644
--- a/7-docker/Dockerfile
+++ b/7-docker/Dockerfile
@@ -1,11 +1,15 @@
# Use Ubuntu as a base image
-FROM ubuntu
+FROM ubuntu:22.04
# Update and install nginx
-RUN apt-get update && apt-get install -y nginx
+RUN apt-get update
+
+RUN apt-get install -y nginx
# Copy the custom index file to the nginx directory
-COPY index.nginx-debian.html /var/www/html
+COPY index.html /var/www/html
+
+EXPOSE 80
# Start nginx in the foreground to keep the container running
CMD ["nginx", "-g", "daemon off;"]
diff --git a/7-docker/Final-project-docker/5.11-docker-compose/Dockerfile b/7-docker/Final-project-docker/5.11-docker-compose/Dockerfile
new file mode 100644
index 0000000..9ec6968
--- /dev/null
+++ b/7-docker/Final-project-docker/5.11-docker-compose/Dockerfile
@@ -0,0 +1,5 @@
+FROM python:3.4-alpine
+ADD . /code
+WORKDIR /code
+RUN pip install -r requirements.txt
+CMD ["python", "app.py"]
diff --git a/7-docker/Final-project-docker/5.11-docker-compose/README.md b/7-docker/Final-project-docker/5.11-docker-compose/README.md
new file mode 100644
index 0000000..ae09000
--- /dev/null
+++ b/7-docker/Final-project-docker/5.11-docker-compose/README.md
@@ -0,0 +1,348 @@
+# Lesson 5 Demo 11: Convert an Application Deployment into a Stack
+
+This section will guide you to:
+- Convert an application deployment into a stack using a file named docker-compose.yml
+
+| Feature | Docker Service | Docker Stack |
+|---------|----------------|--------------|
+| Definition | A Docker Service is the definition of the tasks to execute on the manager or worker nodes. It is a part of Docker Swarm, Docker's built-in orchestration solution. | A Docker Stack is a group of interrelated services that share dependencies, and can be orchestrated and scaled together. A stack effectively encapsulates a multi-service application. |
+| Use Case | Docker Services are ideal for deploying the same image across multiple environments. You can adjust the number of replicas for each service based on the environment's requirements. | Docker Stacks are perfect for defining and managing multi-service applications. Stacks allow you to manage all the services of an application with just one file. |
+| Scale | Services can be scaled up or down individually. | All services within a stack are scaled together, maintaining the application's functionality. |
+| Command | `docker service create` | `docker stack deploy` |
+
+### Step 1: Drain the worker nodes in the swarm cluster to make sure the registry service runs on the manager node
+- List all the nodes present in the swarm cluster and ensure that all nodes are in Active state
+
+```
+sudo docker node ls
+
+```
+
+
+**Note**: Copy the HOSTNAME of worker nodes
+- Use the following command to drain the worker nodes:
+
+```
+sudo docker node update --availability drain hostname_Worker_Node
+
+```
+
+
+**Note**: Replace hostname_Worker_Node with the HOSTNAME copied in previous ### Step
+
+
+### Step 2: Start the registry as a service on your swarm
+
+```
+sudo docker service create --name registry --publish published=5000,target=5000 registry:2
+
+
+```
+
+
+### Step 3: List the running services to check the status of registry service
+
+```
+sudo docker service ls
+
+```
+
+
+
+### Step 4: Check if registry service is working with curl
+
+```
+
+curl http://localhost:5000/v2/
+
+```
+
+
+
+### Step 5: Create a directory for the project
+
+```
+
+mkdir stackdemo
+cd stackdemo
+
+```
+
+
+
+### Step 6: Create a file called app.py in the stackdemo directory
+- Use the following command to create a project file:
+
+```
+
+nano app.py
+
+```
+
+
+- Add the following code in the app.py file:
+
+```
+
+from flask import Flask
+from redis import Redis
+
+app = Flask(__name__)
+redis = Redis(host='redis', port=6379)
+
+@app.route('/')
+def hello():
+ count = redis.incr('hits')
+ return 'Hello World! I have been seen {} times.\n'.format(count)
+
+if __name__ == "__main__":
+ app.run(host="0.0.0.0", port=8000, debug=True)
+
+```
+
+
+**Note**: Press Ctrl+X to exit the editor. Then type Y and press Enter to save the file.
+
+### Step 7: Create a file called requirements.txt
+- Use the following command to create and open requirements.txt:
+
+```
+
+nano requirements.txt
+
+```
+
+
+- Add the following text in the requirements.txt file:
+
+```
+
+flask
+redis
+
+```
+
+
+**Note**: Press Ctrl+X to exit the editor. Then type Y and press Enter to save the file.
+
+### Step 8: Create a file called Dockerfile
+- Use the following command to create a Dockerfile:
+
+```
+
+nano Dockerfile
+
+```
+
+
+- Add the following code in the Dockerfile:
+
+```
+
+FROM python:3.4-alpine
+ADD . /code
+WORKDIR /code
+RUN pip install -r requirements.txt
+CMD ["python", "app.py"]
+
+```
+
+
+**Note**: Press Ctrl+X to exit the editor. Then type Y and press Enter to save the file.
+
+### Step 9: Create a file named docker-compose.yml
+- Use the following command to create the docker-compose.yml file:
+
+```
+
+nano docker-compose.yml
+
+```
+
+
+- Add the following code in the docker-compose.yml file:
+
+```
+
+version: "3.3"
+services:
+ web:
+ image: 127.0.0.1:5000/stackdemo
+ build: .
+ ports:
+ - "8000:8000"
+ redis:
+ image: redis:alpine
+
+```
+
+
+**Note**: Press Ctrl+X to exit the editor. Then type Y and press Enter to save the file.
+
+### Step 10: Start the application
+- Use the following commands to install docker-compose:
+
+```
+sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
+
+
+sudo chmod +x /usr/local/bin/docker-compose
+ docker-compose --version
+
+```
+
+
+
+
+- Start docker-compose using the following command:
+
+```
+sudo docker-compose up -d
+
+```
+
+
+
+
+### Step 11: Use the following commands to check whether the app is running
+
+```
+sudo docker-compose ps
+
+curl http://localhost:8000
+
+```
+
+
+
+### Step 12: Bring the application down
+
+```
+sudo docker-compose down --volumes
+
+
+```
+
+
+### Step 13: Push the application to the registry
+
+```
+sudo docker-compose push
+
+```
+
+
+
+### Step 14: Use the following command to create the stack docker stack deploy:
+
+```
+sudo docker stack deploy --compose-file docker-compose.yml stackdemo
+
+```
+
+
+
+### Step 15: Check if the stack is running
+
+```
+sudo docker stack services stackdemo
+
+```
+
+
+
+### Step 16: Test the app again with curl command
+
+```
+
+curl http://localhost:8000
+curl http://ip-172-31-26-147:8000
+
+```
+
+**Note**: In ### Step 10 while starting docker-compose if you get an error showing the port is already assigned, run the command
+
+```
+sudo docker ps and kill the container with the same port and then proceed.
+
+```
+
+
+
+### Step 17: Use the following command to bring the stack down:
+
+```
+sudo docker stack rm stackdemo
+
+```
+
+-----------------------------------------------------------------
+
+# Lesson 5 Demo 12: Increase Number of Replicas
+
+This section will guide you to:
+- Increase the number of replicas of a task for any given service
+
+### Step 1: List the Docker services
+
+```
+sudo docker service ls
+```
+
+### Step 2: Scale up the redis service to five tasks
+
+```
+sudo docker service scale redis=5
+ ```
+
+### Step 3: Scale the registry service to four tasks using update flag
+
+```
+sudo docker service update --replicas=4 registry
+ ```
+
+### Step 4: Use the scale flag to scale both redis and registry services at the same time
+
+```
+sudo docker service scale redis=4 registry=3
+ ```
+
+### Step 5: Check the actual number of replicas created
+
+```
+sudo docker service ls
+ ```
+
+### Step 6: Create a global service and scale it up to ten tasks
+
+```
+sudo docker service create --mode global --name nginx nginx:latest
+
+
+sudo docker service scale nginx=10
+```
+
+**Note**: Notice that the scaling cannot be used with global services. It can only be done with replicated service.
+
+
+# Disclaimer
+
+
+Please **Note** that the entire repository is owned and maintained by [Varun Kumar Manik](https://www.linkedin.com/in/vkmanik/). While every effort has been made to ensure the accuracy and reliability of the information and resources provided in this repository, Varun Kumar Manik takes full responsibility for any errors or inaccuracies that may be present.
+
+Simplilearn is not responsible for the content or materials provided in this repository and disclaims all liability for any issues, misunderstandings, or claims that may arise from the use of the information or materials provided. By using this repository, you acknowledge that Varun Kumar Manik is solely accountable for its content, and you agree to hold Simplilearn harmless from any claims or liabilities that may arise as a result of your use or reliance on the information provided herein.
+
+It is important to understand that this repository contains educational materials for a training course, and users are expected to apply their own judgment and discretion when utilizing the provided resources. Neither Varun Kumar Manik nor Simplilearn can guarantee specific results or outcomes from following the materials in this repository.
+
+
+
+## Connect & Follow
+
+For more info, please connect and follow me:
+
+- Github: [https://github.com/manikcloud](https://github.com/manikcloud)
+- LinkedIn: [https://www.linkedin.com/in/vkmanik/](https://www.linkedin.com/in/vkmanik/)
+- Email: [varunmanik1@gmail.com](mailto:varunmanik1@gmail.com)
+- Facebook: [https://www.facebook.com/cloudvirtualization/](https://www.facebook.com/cloudvirtualization/)
+- YouTube: [https://bit.ly/32fknRN](https://bit.ly/32fknRN)
+- Twitter: [https://twitter.com/varunkmanik](https://twitter.com/varunkmanik)
diff --git a/7-docker/Final-project-docker/5.11-docker-compose/app.py b/7-docker/Final-project-docker/5.11-docker-compose/app.py
new file mode 100644
index 0000000..c3bfb04
--- /dev/null
+++ b/7-docker/Final-project-docker/5.11-docker-compose/app.py
@@ -0,0 +1,13 @@
+from flask import Flask
+from redis import Redis
+
+app = Flask(__name__)
+redis = Redis(host='redis', port=6379)
+
+@app.route('/')
+def hello():
+ count = redis.incr('hits')
+ return 'Hello World! I have been seen {} times.\n'.format(count)
+
+if __name__ == "__main__":
+ app.run(host="0.0.0.0", port=8000, debug=True)
diff --git a/7-docker/Final-project-docker/5.11-docker-compose/requirements.txt b/7-docker/Final-project-docker/5.11-docker-compose/requirements.txt
new file mode 100644
index 0000000..02c585a
--- /dev/null
+++ b/7-docker/Final-project-docker/5.11-docker-compose/requirements.txt
@@ -0,0 +1,2 @@
+flask
+redis
diff --git a/7-docker/README.md b/7-docker/README.md
index 0acced9..13d7062 100644
--- a/7-docker/README.md
+++ b/7-docker/README.md
@@ -1,5 +1,5 @@
# Docker
-
+- [# Docekr basic commands & their flags](#Docekr-basic-commands-their-flags)
- [Lesson 7 Demo 2: Performing CRUD Operation on Containers](#lesson-7-demo-2)
- [Step 1: Pulling a Docker image](#step-1-pulling-a-docker-image)
- [Step 2: Creating a new container](#step-2-creating-a-new-container)
@@ -23,6 +23,26 @@
- [Step 3: Connecting the network from another SSH server](#step-3-connecting-the-network-from-another-ssh-server)
+
+# Docekr basic commands their flags
+
+| Command | Description | Flags/Options |
+|---------|-------------|---------------|
+| `docker run` | Run a new container | `-d` (detached), `-p` (port mapping), `--name` (name of the container), `-e` (environment variables) |
+| `docker ps` | List running containers | `-a` (all containers), `--format` (format output) |
+| `docker stop` | Stop a running container | `` (ID or name of the container) |
+| `docker rm` | Remove a container | `-f` (force), `` |
+| `docker images` | List Docker images | `-a` (all images), `--format` (format output) |
+| `docker rmi` | Remove a Docker image | `` (ID or name of the image), `-f` (force) |
+| `docker build` | Build an image from a Dockerfile | `-t` (tag/name of the image), `` |
+| `docker pull` | Pull an image from a registry | `` (name of the image) |
+| `docker push` | Push an image to a registry | `` (name of the image) |
+| `docker exec` | Execute a command in a running container | `-it` (interactive terminal), `` (ID or name of the container), `` (command to execute) |
+| `docker logs` | Fetch the logs of a container | `` (ID or name of the container), `--tail` (number of lines to show) |
+| `docker network` | Manage Docker networks | `create`, `inspect`, `ls`, `rm` (subcommands for network management) |
+| `docker volume` | Manage Docker volumes | `create`, `inspect`, `ls`, `rm` (subcommands for volume management) |
+
+
# Lesson 7 Demo 2
Performing CRUD Operation on Containers
diff --git a/7-docker/index.html b/7-docker/index.html
index 6d580ec..e0cf6b2 100644
--- a/7-docker/index.html
+++ b/7-docker/index.html
@@ -3,7 +3,8 @@
My First Heading
-My first paragraph.
+Lorem ipsum...
+This is DevOps class.
-