From 10d3eec647158a84d6f33ae4ba4c9fe3b07bdda7 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 09:56:54 -0700 Subject: [PATCH 01/36] created the project foler --- app_python/main.py | 17 +++++++++++++++++ app_python/requirements.txt | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 app_python/main.py create mode 100644 app_python/requirements.txt diff --git a/app_python/main.py b/app_python/main.py new file mode 100644 index 000000000..00c8b1f82 --- /dev/null +++ b/app_python/main.py @@ -0,0 +1,17 @@ +from datetime import datetime + +from flask import Flask + +app = Flask(__name__) + +def get_current_time(): + now = datetime.now() + current_time = now.strftime("Current Time in Moscow: %Y-%m-%d %H:%M:%S") + return current_time + +@app.route('/') +def home(): + return get_current_time() + +if __name__ == '__main__': + app.run(host="0.0.0.0", debug=True) \ No newline at end of file diff --git a/app_python/requirements.txt b/app_python/requirements.txt new file mode 100644 index 000000000..496a52930 --- /dev/null +++ b/app_python/requirements.txt @@ -0,0 +1,2 @@ +pytz +Flask==2.0.1 From ea7d0ac23abe2b30b9f9571face78e8d099bf9bc Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 09:59:31 -0700 Subject: [PATCH 02/36] Submitting the first lab for review --- app_python/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app_python/README.md diff --git a/app_python/README.md b/app_python/README.md new file mode 100644 index 000000000..10fe0e7c5 --- /dev/null +++ b/app_python/README.md @@ -0,0 +1,12 @@ +# Current Time in Moscow + +## Overview +This is a simple Python web application that displays the current time in Moscow. It uses the Flask web framework and the datetime module to get the current time in the Europe/Moscow timezone. The time is displayed in a user-friendly format on a web page. + +## Build +To build this application, you need to create a Python file with a main.py extension, for example, app.py. Then, copy the code in main.py to your file. Save the file and run it using the command python app.py in a terminal or command prompt. +The application will start running on your local machine. + +## Usage +To use the application, open a web browser and navigate to http://localhost:5000/. The current time in Moscow will be displayed on the web page. The time will be updated every time you refresh the page. + From 730c9a49676a55c4ff1722d30285895d3fcc4316 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 10:11:48 -0700 Subject: [PATCH 03/36] updated the readme with the docker instruction and also added docker to the project --- app_python/Dockerfile | 15 +++++++++++++++ app_python/README.md | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 app_python/Dockerfile diff --git a/app_python/Dockerfile b/app_python/Dockerfile new file mode 100644 index 000000000..c0c54690e --- /dev/null +++ b/app_python/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3-alpine + +WORKDIR /main + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 8081 + +CMD ["python3", "main.py"] + + diff --git a/app_python/README.md b/app_python/README.md index 10fe0e7c5..0be939514 100644 --- a/app_python/README.md +++ b/app_python/README.md @@ -10,3 +10,22 @@ The application will start running on your local machine. ## Usage To use the application, open a web browser and navigate to http://localhost:5000/. The current time in Moscow will be displayed on the web page. The time will be updated every time you refresh the page. +## To run the Dockerfile in your project, you can follow these steps: + +1. Make sure that you have Docker installed on your local machine. You can download Docker from the official website: https://www.docker.com/products/docker-desktop + +2. Open a terminal or command prompt and navigate to the directory that contains your Dockerfile. + +3. Build the Docker image using the following command: + docker build -t . + Make sure to replace with the name that you want to give to your Docker image. The . at the end of the command specifies that the build context is the current directory. + +4. Once the build is complete, you can run the Docker container using the following command: + docker run -p : + +Make sure to replace with the port number on your local machine that you want to use to access the container, with the port number that your application is listening on inside the container, and with the name of the Docker image that you built in step 3. + +For example, if your application is listening on port 80 inside the container and you want to access it on port 8080 on your local machine, you can use the following command: + docker run -p 8080:80 + +5. Once the container is running, you can access your application by opening a web browser and navigating to http://localhost:. In the example above, you would navigate to http://localhost:8080. From 274912b8287db91ddb7aa3f1a5fc47780485546d Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 10:31:54 -0700 Subject: [PATCH 04/36] Added Github action to the project --- README.md | 80 +++++++++++++-------------- app_python/.github/workflows/main.yml | 49 ++++++++++++++++ app_python/README.md | 31 ----------- app_python/test_main.py | 14 +++++ 4 files changed, 101 insertions(+), 73 deletions(-) create mode 100644 app_python/.github/workflows/main.yml delete mode 100644 app_python/README.md create mode 100644 app_python/test_main.py diff --git a/README.md b/README.md index 119379536..359f2066f 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,62 @@ -# Labs +# Current Time in Moscow -## Introduction +![Python CI](https://github.com/haraphat01/moscow_time/workflows/Python%20CI/badge.svg) -Welcome to DevOps course labs. All labs are practical and will be built on each other. You will implement simple application, containerize it, implement simple tests, prepare an infrastructure and CI/CD processes, collect metrics, logs, etc. -## Architecture +## Overview +This is a simple Python web application that displays the current time in Moscow. It uses the Flask web framework and the datetime module to get the current time in the Europe/Moscow timezone. The time is displayed in a user-friendly format on a web page. -This repository contains a master branch with introduction and one branch with instructions for each lab. +## Build +To build this application, you need to create a Python file with a main.py extension, for example, app.py. Then, copy the code in main.py to your file. Save the file and run it using the command python app.py in a terminal or command prompt. +The application will start running on your local machine. -## Rules +## Usage +To use the application, open a web browser and navigate to http://localhost:5000/. The current time in Moscow will be displayed on the web page. The time will be updated every time you refresh the page. -Each labs requires the participant to finish all previous labs, therefore **participants are required to submit each lab and get at least 6/10 points for each lab to pass the course**. +## To run the Dockerfile in your project, you can follow these steps: -Grading is based on PRs with your solution to the corresponding branch of this repository. This repository is read-only for all participants, therefore to be able to create a pull request, a participant should fork this repository to his own workspace and solve the lab there. It is recommended to build a solution of a lab N upon a solution of lab N-1, so choose workflow in your fork of this repository wisely. Structure of your repository will not affect your grade, only state of your repository from which the PR is created will be checked and graded (state after last commit in your PR on corresponding lab). +1. Make sure that you have Docker installed on your local machine. You can download Docker from the official website: https://www.docker.com/products/docker-desktop -### Recommended workflow +2. Open a terminal or command prompt and navigate to the directory that contains your Dockerfile. -#### For the first lab +3. Build the Docker image using the following command: + docker build -t . + Make sure to replace with the name that you want to give to your Docker image. The . at the end of the command specifies that the build context is the current directory. -1. Fork this repository. -2. Checkout to lab1 branch. -3. Complete lab1 tasks. -4. Push the code to your repository. -5. Create a PR to the lab1 branch on this repository from your fork's lab1 branch. -6. Create an archive with the current version of your code and submit a zip file to Moodle. -7. Create a team with with your classmates, 6 people max. -8. Each student must review PRs of all teammates. -9. Wait for your grade. +4. Once the build is complete, you can run the Docker container using the following command: + docker run -p : -## Grading +Make sure to replace with the port number on your local machine that you want to use to access the container, with the port number that your application is listening on inside the container, and with the name of the Docker image that you built in step 3. -### Points distribution for the course +For example, if your application is listening on port 80 inside the container and you want to access it on port 8080 on your local machine, you can use the following command: + docker run -p 8080:80 -``` -70 - labs -20 - final exam -10 - attendance on lectures -``` +5. Once the container is running, you can access your application by opening a web browser and navigating to http://localhost:. In the example above, you would navigate to http://localhost:8080. -### Grade ranges +## Unit tests -``` -[90;100] - A -[75;90) - B -[60;75) - C -[0;60) - D -``` +I have written unit tests for the Python web application that displays the current time in Moscow. These tests ensure that the application is working as expected and help us catch any bugs early in the development process. -### Labs grading +To run the unit tests, navigate to the directory where the `test_main.py` file is located and run the following command: +python test_main.py -Each lab is marked out of 10. All labs have a set of main tasks and a set of extra tasks. -Completing main tasks correctly will give you 10 points out of 10. Completing extra tasks correctly will give you some additional points, depends on the bonus task difficulty. Your points for main and extra tasks will be summed up and will help you to get a better grade. +Make sure that you have all the necessary dependencies installed, including Flask and any other modules that your application depends on. -If you finish all bonus tasks correctly the **permission to skip the exam will be granted to you + 10 extra points**. If you finish not all of them you will must pass the exam, but it can save you from the exam's failure. +If the tests pass successfully, you should see output similar to the following: -## Deadlines and labs distribution +Ran 1 test in 0.001s -Participants have 2 new labs every week simultaneously and 1 week to submit solutions. Moodle will contain presentations and deadlines. +OK -You are required to submit a zip file with your source code to corresponding assignment in moodle. This is required for the university as a proof of work. -## Submission policy +## Git Actions CI + +I have set up a continuous integration (CI) workflow using Git Actions to build and test our Python web application. The workflow has three steps: installing dependencies, running linters, and running unit tests. + +To run the workflow, push changes to the `main` branch of the repository. The workflow will automatically be triggered and the steps will be run in order. Make sure that you have all the necessary dependencies installed, including Flask and any other modules that your application depends on. + +I have also added Docker-related steps to our workflow to log in to a Docker registry, build a Docker image, and push the image to the registry. To use these steps, you will need to set up the `DOCKER_USERNAME` and `DOCKER_PASSWORD` secrets in your repository settings. + +By following these best practices and including a Git Actions CI workflow in your project, I can ensure that my application is thoroughly tested and working as expected. -**Submitting results after the deadline will result in maximum of 6 points for the corresponding lab. As stated before, all labs must be submitted to pass the course.** diff --git a/app_python/.github/workflows/main.yml b/app_python/.github/workflows/main.yml new file mode 100644 index 000000000..247c4afb9 --- /dev/null +++ b/app_python/.github/workflows/main.yml @@ -0,0 +1,49 @@ +name: Python CI + +on: + push: + branches: [lab3] + +jobs: + build_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10.7' + - name: Install dependencies + run: pip install -r requirements.txt + - name: Upgrade Flask and Werkzeug + run: pip install --upgrade Flask + - name: Run unit tests + run: python3 test_main.py + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + deploy: + needs: build_test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Log in to Docker registry + uses: docker/login-action@v1 + with: + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: docker.io/haraphat01/moscowtime:tagname \ No newline at end of file diff --git a/app_python/README.md b/app_python/README.md deleted file mode 100644 index 0be939514..000000000 --- a/app_python/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Current Time in Moscow - -## Overview -This is a simple Python web application that displays the current time in Moscow. It uses the Flask web framework and the datetime module to get the current time in the Europe/Moscow timezone. The time is displayed in a user-friendly format on a web page. - -## Build -To build this application, you need to create a Python file with a main.py extension, for example, app.py. Then, copy the code in main.py to your file. Save the file and run it using the command python app.py in a terminal or command prompt. -The application will start running on your local machine. - -## Usage -To use the application, open a web browser and navigate to http://localhost:5000/. The current time in Moscow will be displayed on the web page. The time will be updated every time you refresh the page. - -## To run the Dockerfile in your project, you can follow these steps: - -1. Make sure that you have Docker installed on your local machine. You can download Docker from the official website: https://www.docker.com/products/docker-desktop - -2. Open a terminal or command prompt and navigate to the directory that contains your Dockerfile. - -3. Build the Docker image using the following command: - docker build -t . - Make sure to replace with the name that you want to give to your Docker image. The . at the end of the command specifies that the build context is the current directory. - -4. Once the build is complete, you can run the Docker container using the following command: - docker run -p : - -Make sure to replace with the port number on your local machine that you want to use to access the container, with the port number that your application is listening on inside the container, and with the name of the Docker image that you built in step 3. - -For example, if your application is listening on port 80 inside the container and you want to access it on port 8080 on your local machine, you can use the following command: - docker run -p 8080:80 - -5. Once the container is running, you can access your application by opening a web browser and navigating to http://localhost:. In the example above, you would navigate to http://localhost:8080. diff --git a/app_python/test_main.py b/app_python/test_main.py new file mode 100644 index 000000000..676849e5e --- /dev/null +++ b/app_python/test_main.py @@ -0,0 +1,14 @@ +import unittest +from main import app + +class TestApp(unittest.TestCase): + def setUp(self): + self.app = app.test_client() + + def test_homepage(self): + response = self.app.get('/') + self.assertEqual(response.status_code, 200) + self.assertIn(b'Current Time in Moscow', response.data) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file From 33ce6eecdae793a038793f83366e2d2a3cec1bf7 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 10:41:06 -0700 Subject: [PATCH 05/36] Added Github action to the project --- app_python/.github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app_python/.github/workflows/main.yml b/app_python/.github/workflows/main.yml index 247c4afb9..b028a19d1 100644 --- a/app_python/.github/workflows/main.yml +++ b/app_python/.github/workflows/main.yml @@ -1,8 +1,8 @@ -name: Python CI +name: Python CI22 on: push: - branches: [lab3] + branches: [lab34] jobs: build_test: From 799ebdbd622b260f62a2f43d3235d17b3370876c Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 11:07:05 -0700 Subject: [PATCH 06/36] Added Github action to the project --- app_python/.github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app_python/.github/workflows/main.yml b/app_python/.github/workflows/main.yml index b028a19d1..82584c954 100644 --- a/app_python/.github/workflows/main.yml +++ b/app_python/.github/workflows/main.yml @@ -1,8 +1,8 @@ -name: Python CI22 +name: Python CI on: push: - branches: [lab34] + branches: [lab3] jobs: build_test: @@ -18,7 +18,7 @@ jobs: - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests - run: python3 test_main.py + run: python3 test_main - name: Cache dependencies uses: actions/cache@v2 with: From 6ae43df9b33ed3f944b3516b78b921fea503caf9 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 11:32:17 -0700 Subject: [PATCH 07/36] added the github workflows --- {app_python/.github/workflows => workflows}/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {app_python/.github/workflows => workflows}/main.yml (100%) diff --git a/app_python/.github/workflows/main.yml b/workflows/main.yml similarity index 100% rename from app_python/.github/workflows/main.yml rename to workflows/main.yml From 8c60aefe547ae6df7bf24222f0f85d8daeb0ab93 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 13:16:01 -0700 Subject: [PATCH 08/36] Fixing the bug on the github action --- {workflows => github/workflows}/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename {workflows => github/workflows}/main.yml (89%) diff --git a/workflows/main.yml b/github/workflows/main.yml similarity index 89% rename from workflows/main.yml rename to github/workflows/main.yml index 82584c954..1d231bc58 100644 --- a/workflows/main.yml +++ b/github/workflows/main.yml @@ -18,14 +18,14 @@ jobs: - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests - run: python3 test_main + run: python3 test_main.py - name: Cache dependencies uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-pip- deploy: needs: build_test runs-on: ubuntu-latest @@ -46,4 +46,5 @@ jobs: with: context: . push: true - tags: docker.io/haraphat01/moscowtime:tagname \ No newline at end of file + tags: docker.io/haraphat01/moscowtime:tagname + \ No newline at end of file From 9a034215a9247c5d28937de13197a1e01d8f92ce Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 13:21:17 -0700 Subject: [PATCH 09/36] Fixing the bug on the github action --- {github => app_python/github}/workflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {github => app_python/github}/workflows/main.yml (100%) diff --git a/github/workflows/main.yml b/app_python/github/workflows/main.yml similarity index 100% rename from github/workflows/main.yml rename to app_python/github/workflows/main.yml From 7705a258b89ad68fd16fee78d247e11a00bde6c3 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 22:40:42 -0700 Subject: [PATCH 10/36] Fixing the bug on the github action --- {app_python/github => .github}/workflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {app_python/github => .github}/workflows/main.yml (100%) diff --git a/app_python/github/workflows/main.yml b/.github/workflows/main.yml similarity index 100% rename from app_python/github/workflows/main.yml rename to .github/workflows/main.yml From 6808a07439424661866986eaef110e45f9262add Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 22:42:05 -0700 Subject: [PATCH 11/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d231bc58..514328422 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-pip- deploy: needs: build_test runs-on: ubuntu-latest From 54626b3457eab3cbd9e897a81ac067efc43e8c3d Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 22:48:15 -0700 Subject: [PATCH 12/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 514328422..701af809c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: python-version: '3.10.7' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install -r /app_python/to/requirements.txt - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests From 4e829ba07512abf0eaa1e279a52391ca74d505eb Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 22:49:56 -0700 Subject: [PATCH 13/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 701af809c..7921376e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: python-version: '3.10.7' - name: Install dependencies - run: pip install -r /app_python/to/requirements.txt + run: pip install -r /app_python/requirements.txt - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests From 848afa155ea26904ad6c7ea646ed9e8bf623ea16 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 22:53:33 -0700 Subject: [PATCH 14/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- app_python/requirements.txt => requirements.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename app_python/requirements.txt => requirements.txt (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7921376e5..514328422 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: python-version: '3.10.7' - name: Install dependencies - run: pip install -r /app_python/requirements.txt + run: pip install -r requirements.txt - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests diff --git a/app_python/requirements.txt b/requirements.txt similarity index 100% rename from app_python/requirements.txt rename to requirements.txt From 6794b88c48c9e04c0ca2d7df671ee887f772193d Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 23:07:34 -0700 Subject: [PATCH 15/36] Fixing the bug on the github action --- .github/workflows/main.yml | 5 ++++- requirements.txt => app_python/requirements.txt | 0 2 files changed, 4 insertions(+), 1 deletion(-) rename requirements.txt => app_python/requirements.txt (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 514328422..b8a434843 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,9 @@ name: Python CI on: push: branches: [lab3] + paths: + - "app_python/**" + - ".github/workflows/main.yaml" jobs: build_test: @@ -14,7 +17,7 @@ jobs: with: python-version: '3.10.7' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install -r app_python/requirements.txt - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests diff --git a/requirements.txt b/app_python/requirements.txt similarity index 100% rename from requirements.txt rename to app_python/requirements.txt From 34181a46c357e7334403c9736f175b5c4ec16779 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 23:09:11 -0700 Subject: [PATCH 16/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8a434843..0665269cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests - run: python3 test_main.py + run: python3 app_python/test_main.py - name: Cache dependencies uses: actions/cache@v2 with: From 93f19e40ecc69f663ba78bc0183ea1957babedba Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 23:11:34 -0700 Subject: [PATCH 17/36] Fixing the bug on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0665269cd..67c7d0031 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests - run: python3 app_python/test_main.py + run: python3 app_python/test_main1.py - name: Cache dependencies uses: actions/cache@v2 with: From e7df1e973549c15e9fe91a8a6ff3cd2e924468f0 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 5 Jun 2023 23:12:50 -0700 Subject: [PATCH 18/36] Fixing the bug on the github action configuration --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67c7d0031..0665269cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: - name: Upgrade Flask and Werkzeug run: pip install --upgrade Flask - name: Run unit tests - run: python3 app_python/test_main1.py + run: python3 app_python/test_main.py - name: Cache dependencies uses: actions/cache@v2 with: From e81501b9141b00dcbf7d87f2d540f43d0f259a2a Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 08:23:29 -0700 Subject: [PATCH 19/36] Updated the CI action --- app_python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app_python/main.py b/app_python/main.py index 00c8b1f82..cbfe24e1c 100644 --- a/app_python/main.py +++ b/app_python/main.py @@ -14,4 +14,5 @@ def home(): return get_current_time() if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True) \ No newline at end of file + app.run(host="0.0.0.0", debug=True) +# This app load here \ No newline at end of file From 3f7c03790ec138f6f0f42c60088d2d37338f0cb4 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 08:53:30 -0700 Subject: [PATCH 20/36] Fixing the bug on the github action configuration --- app_python/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app_python/main.py b/app_python/main.py index cbfe24e1c..00c8b1f82 100644 --- a/app_python/main.py +++ b/app_python/main.py @@ -14,5 +14,4 @@ def home(): return get_current_time() if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True) -# This app load here \ No newline at end of file + app.run(host="0.0.0.0", debug=True) \ No newline at end of file From 053db9d169c53fb95abb4ea6ce6d8a4bb6e869b9 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 08:57:43 -0700 Subject: [PATCH 21/36] Fixing the bug on the github action configuration --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0665269cd..d5a097585 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . + file: .app_python/Dockerfile push: true tags: docker.io/haraphat01/moscowtime:tagname \ No newline at end of file From 7386686ca14b50afc8a1b514af9b9433f9d75fc6 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 12:15:17 -0700 Subject: [PATCH 22/36] Added a comment to the main file --- app_python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app_python/main.py b/app_python/main.py index 00c8b1f82..7f7eab592 100644 --- a/app_python/main.py +++ b/app_python/main.py @@ -14,4 +14,5 @@ def home(): return get_current_time() if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True) \ No newline at end of file + app.run(host="0.0.0.0", debug=True) +# test \ No newline at end of file From c6875ba63550a95aa90ffbd3f21970f73df78c5e Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 12:41:40 -0700 Subject: [PATCH 23/36] Added a comment to the main file --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5a097585..d4e485885 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: .app_python/Dockerfile + file: app_python/Dockerfile push: true tags: docker.io/haraphat01/moscowtime:tagname \ No newline at end of file From 3d21bdfd37be1c5192873de0ea72f7e8a97309c0 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 13:05:50 -0700 Subject: [PATCH 24/36] Added a comment to the main file --- app_python/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app_python/main.py b/app_python/main.py index 7f7eab592..00c8b1f82 100644 --- a/app_python/main.py +++ b/app_python/main.py @@ -14,5 +14,4 @@ def home(): return get_current_time() if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True) -# test \ No newline at end of file + app.run(host="0.0.0.0", debug=True) \ No newline at end of file From a9bd2c6c157c7da4a73aa22d8800c28dd6d1589a Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 13:14:07 -0700 Subject: [PATCH 25/36] Fixing the bug on the github action configuration --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4e485885..f2b9f2824 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('app_python/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- deploy: From 6fe7211f816972d6498569e550f3d3ed8238bb10 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 21:26:12 -0700 Subject: [PATCH 26/36] Fixing the bug on the github action configuration --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2b9f2824..de63f0dc4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,13 +22,13 @@ jobs: run: pip install --upgrade Flask - name: Run unit tests run: python3 app_python/test_main.py - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('app_python/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + # - name: Cache dependencies + # uses: actions/cache@v2 + # with: + # path: ~/.cache/pip + # key: ${{ runner.os }}-pip-${{ hashFiles('app_python/requirements.txt') }} + # restore-keys: | + # ${{ runner.os }}-pip- deploy: needs: build_test runs-on: ubuntu-latest From 0a609e4c3aa58a2a241b70494da94c47222899db Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Tue, 6 Jun 2023 21:26:44 -0700 Subject: [PATCH 27/36] Added a comment to the main file --- .github/workflows/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de63f0dc4..c7845191b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,13 +22,7 @@ jobs: run: pip install --upgrade Flask - name: Run unit tests run: python3 app_python/test_main.py - # - name: Cache dependencies - # uses: actions/cache@v2 - # with: - # path: ~/.cache/pip - # key: ${{ runner.os }}-pip-${{ hashFiles('app_python/requirements.txt') }} - # restore-keys: | - # ${{ runner.os }}-pip- + deploy: needs: build_test runs-on: ubuntu-latest From 2e00bc80aca46cc5930ed565d26f2deafcdd7476 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Wed, 7 Jun 2023 11:10:31 -0700 Subject: [PATCH 28/36] Reworked on the github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7845191b..d70cebd23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: run: pip install --upgrade Flask - name: Run unit tests run: python3 app_python/test_main.py - + deploy: needs: build_test runs-on: ubuntu-latest From 1ece35166c0fdd0f437f712e685216ff0acda7f3 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Wed, 7 Jun 2023 13:08:17 -0700 Subject: [PATCH 29/36] Reworked on the github action --- app_python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_python/Dockerfile b/app_python/Dockerfile index c0c54690e..755aea5e0 100644 --- a/app_python/Dockerfile +++ b/app_python/Dockerfile @@ -1,5 +1,5 @@ FROM python:3-alpine - +USER root WORKDIR /main COPY requirements.txt . From a93ef1287ab698467d890307bb3adf69ab80a1bf Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Wed, 7 Jun 2023 13:20:15 -0700 Subject: [PATCH 30/36] Reworked on the github action --- app_python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_python/Dockerfile b/app_python/Dockerfile index 755aea5e0..eb3113a8d 100644 --- a/app_python/Dockerfile +++ b/app_python/Dockerfile @@ -2,7 +2,7 @@ FROM python:3-alpine USER root WORKDIR /main -COPY requirements.txt . +COPY app_python/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt From baa03fb30734c6376b1899fc4adb7ec36cb3db01 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Sat, 10 Jun 2023 09:15:56 -0700 Subject: [PATCH 31/36] Added the terraform file --- terraform/TF.md | 0 terraform/main.tf | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 terraform/TF.md create mode 100644 terraform/main.tf diff --git a/terraform/TF.md b/terraform/TF.md new file mode 100644 index 000000000..e69de29bb diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 000000000..68d9bef50 --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,24 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~> 3.0.1" + } + } +} + +provider "docker" {} + +resource "docker_image" "nginx" { + name = "nginx:latest" + keep_locally = false +} + +resource "docker_container" "nginx" { + image = docker_image.nginx.image_id + name = "tutorial" + ports { + internal = 80 + external = 8000 + } +} From 09ea6c1d2b779452343b9d95449e229265e46799 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Sat, 10 Jun 2023 18:17:00 -0700 Subject: [PATCH 32/36] Trying to solve the big file size issue --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 359f2066f..b5094c4a8 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,33 @@ I have also added Docker-related steps to our workflow to log in to a Docker reg By following these best practices and including a Git Actions CI workflow in your project, I can ensure that my application is thoroughly tested and working as expected. +# Terraform AWS Example + +This Terraform configuration sets up an AWS infrastructure with a single EC2 instance running in the `us-west-2` region. The instance is tagged with the name "ExampleAppServerInstance". + +## Prerequisites + +- Terraform >= 1.2.0 +- AWS CLI +- An AWS account with the necessary permissions + +## Configuration + +The `main.tf` file contains the following resources: + +1. **Terraform block**: Specifies the required providers and their versions. +2. **AWS provider block**: Configures the AWS provider with the `us-west-2` region. +3. **AWS instance resource**: Creates an EC2 instance with the specified AMI and instance type. + + +## Usage + +1. Install Terraform and the AWS CLI. +2. Configure your AWS credentials using `aws configure` or by setting the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables. +3. Run `terraform init` to initialize the Terraform working directory. +4. Run `terraform apply` to create the infrastructure. Confirm the changes when prompted. +5. To destroy the infrastructure when you're done, run `terraform destroy`. + +## Customization + +You can customize the configuration by modifying the `main.tf` file. For example, you can change the instance type, region, or add additional resources as needed. \ No newline at end of file From 31a1591640a98c40563f7680744bf7635f7dde54 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Sat, 10 Jun 2023 18:19:13 -0700 Subject: [PATCH 33/36] Added the TF.md file and the output --- terraform/TF.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/terraform/TF.md b/terraform/TF.md index e69de29bb..c959d4200 100644 --- a/terraform/TF.md +++ b/terraform/TF.md @@ -0,0 +1,73 @@ +# Output of Terraform show +docker_container.nginx: +resource “docker_container” “nginx” { attach = false command = [ “nginx”, “-g”, “daemon off;”, ] container_read_refresh_timeout_milliseconds = +15000 cpu_shares = 0 entrypoint = [ “/docker-entrypoint.sh”, ] env = [] hostname = “21dca2656095” id = +“21dca2656095460e1391309cc5904b687acdaee6500a047df9493911addb239c” image = +“sha256:f9c14fe76d502861ba0939bc3189e642c02e257f06f4c0214b1f8ca329326cda” init = false ipc_mode = “private” log_driver = “json-file” logs = +false max_retry_count = 0 memory = 0 memory_swap = 0 must_run = true name = “tutorial” network_data = [ { gateway = “172.17.0.1” +global_ipv6_address = “” global_ipv6_prefix_length = 0 ip_address = “172.17.0.2” ip_prefix_length = 16 ipv6_gateway = “” mac_address = “02:42:ac +11:00:02” network_name = “bridge” }, ] network_mode = “default” privileged = false publish_all_ports = false read_only = false remove_volumes = +true restart = “no” rm = false runtime = “runc” security_opts = [] shm_size = 64 start = true stdin_open = false stop_signal = “SIGQUIT” stop_timeout += 0 tty = false wait = false wait_timeout = 60 +ports { +external = 8000 +internal = 80 +ip = "0.0.0.0" +protocol = "tcp" +} + +} +docker_image.nginx: +resource “docker_image” “nginx” { id = “sha256:f9c14fe76d502861ba0939bc3189e642c02e257f06f4c0214b1f8ca329326cdanginx:latest” image_id = +“sha256:f9c14fe76d502861ba0939bc3189e642c02e257f06f4c0214b1f8ca329326cda” keep_locally = false name = “nginx:latest” repo_digest = +“nginx@sha256:af296b188c7b7df99ba960ca614439c99cb7cf252ed7bbc23e90cfda59092305” } + +# Output of terraform state list +docker_container.nginx docker_image.nginx +aws_instance.app_server: +resource “aws_instance” “app_server” { ami = “ami-08d70e59c07c61a3a” arn = “arn:aws:ec2:us-west-2:354156216263:instance +i-0b39be7dc8d0a893a” associate_public_ip_address = true availability_zone = “us-west-2a” cpu_core_count = 1 cpu_threads_per_core = 1 +disable_api_stop = false disable_api_termination = false ebs_optimized = false get_password_data = false hibernation = false id = +“i-0b39be7dc8d0a893a” instance_initiated_shutdown_behavior = “stop” instance_state = “running” instance_type = “t2.micro” ipv6_address_count = +0 ipv6_addresses = [] monitoring = false placement_partition_number = 0 primary_network_interface_id = “eni-0cc62b162b9c9df4c” private_dns = +“ip-172-31-16-27.us-west-2.compute.internal” private_ip = “172.31.16.27” public_dns = “ec2-35-93-162-232.us-west-2.compute.amazonaws.com” +public_ip = “35.93.162.232” secondary_private_ips = [] security_groups = [ “default”, ] source_dest_check = true subnet_id = +“subnet-039b0778d5eaf2eb4” tags = { “Name” = “ExampleAppServerInstance” } tags_all = { “Name” = “ExampleAppServerInstance” } tenancy = +“default” user_data_replace_on_change = false vpc_security_group_ids = [ “sg-0849ce7988dae5104”, ] +capacity_reservation_specification { +capacity_reservation_preference = "open" +} +cpu_options { +core_count = 1 +threads_per_core = 1 +} +credit_specification { +cpu_credits = "standard" +} +enclave_options { +enabled = false +} +maintenance_options { +auto_recovery = "default" +}metadata_options { +http_endpoint = "enabled" +http_put_response_hop_limit = 1 +http_tokens = "optional" +instance_metadata_tags = "disabled" +} +private_dns_name_options { +enable_resource_name_dns_a_record = false +enable_resource_name_dns_aaaa_record = false +hostname_type = "ip-name" +} +root_block_device { +delete_on_termination = true +device_name = "/dev/sda1" +encrypted = false +iops = 100 +tags = {} +throughput = 0 +volume_id = "vol-0403cb7cdf11b3fb7" +volume_size = 8 +volume_type = "gp2" +} From 7a47bd94f7127ee4ce1a7bfbd9657dc9d9eda3fa Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Mon, 12 Jun 2023 11:14:21 -0700 Subject: [PATCH 34/36] Added ansible yml and a docker role --- ansible/ANSIBLE.md | 0 ansible/docker_playbook.yml | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 ansible/ANSIBLE.md create mode 100644 ansible/docker_playbook.yml diff --git a/ansible/ANSIBLE.md b/ansible/ANSIBLE.md new file mode 100644 index 000000000..e69de29bb diff --git a/ansible/docker_playbook.yml b/ansible/docker_playbook.yml new file mode 100644 index 000000000..fd7f6c531 --- /dev/null +++ b/ansible/docker_playbook.yml @@ -0,0 +1,6 @@ +--- +- name: Deploy Docker role + hosts: all + become: true + roles: + - my_docker_role \ No newline at end of file From 5371f20a040bcaef65f55f349594b931d9b1c8e4 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Wed, 14 Jun 2023 02:43:11 -0700 Subject: [PATCH 35/36] Working on the ansible file --- ansible/ANSIBLE.md | 23 +++++++++++++++++++++++ ansible/ansible.cfg | 6 ++++++ ansible/defaults/main.yml | 3 +++ ansible/docker_playbook.yml | 6 ------ ansible/handlers/main.yml | 6 ++++++ ansible/playbook.yml | 4 ++++ ansible/roles/docker/tasks/main.yml | 13 +++++++++++++ 7 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 ansible/ansible.cfg create mode 100644 ansible/defaults/main.yml delete mode 100644 ansible/docker_playbook.yml create mode 100644 ansible/handlers/main.yml create mode 100644 ansible/playbook.yml create mode 100644 ansible/roles/docker/tasks/main.yml diff --git a/ansible/ANSIBLE.md b/ansible/ANSIBLE.md index e69de29bb..c3236e976 100644 --- a/ansible/ANSIBLE.md +++ b/ansible/ANSIBLE.md @@ -0,0 +1,23 @@ +# Ansible + +This repository contains an Ansible playbook to deploy the Docker role. + +## Prerequisites + +Before running the playbook, you need to have Ansible installed on your system. + +## Usage + +To deploy the Docker role, run the following command: +ansible-playbook playbook.yml --diff + +The `--diff` option enables the diff mode, which shows the changes made by Ansible. + +## Inventory + +To list all the hosts in your inventory, run the following command: +PLAY [all] ********************************************************************* +skipping: no hosts matched + +PLAY RECAP ********************************************************************* + diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 000000000..9143093a3 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,6 @@ +[defaults] +inventory = ./inventory/default_aws_ec2.yml +remote_user = ubuntu + +[privilege_escalation] +become = True \ No newline at end of file diff --git a/ansible/defaults/main.yml b/ansible/defaults/main.yml new file mode 100644 index 000000000..6d2099eb8 --- /dev/null +++ b/ansible/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# defaults file for docker +docker_restart_handler: restart docker diff --git a/ansible/docker_playbook.yml b/ansible/docker_playbook.yml deleted file mode 100644 index fd7f6c531..000000000 --- a/ansible/docker_playbook.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Deploy Docker role - hosts: all - become: true - roles: - - my_docker_role \ No newline at end of file diff --git a/ansible/handlers/main.yml b/ansible/handlers/main.yml new file mode 100644 index 000000000..50d0757a2 --- /dev/null +++ b/ansible/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: restart docker + systemd: + name: docker + state: restarted + become: true \ No newline at end of file diff --git a/ansible/playbook.yml b/ansible/playbook.yml new file mode 100644 index 000000000..748fdfac0 --- /dev/null +++ b/ansible/playbook.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - docker diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml new file mode 100644 index 000000000..757cfc652 --- /dev/null +++ b/ansible/roles/docker/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- name: Install Docker + apt: + name: docker.io + state: present + become: true + +- name: Ensure Docker service is started + systemd: + name: docker + state: started + enabled: true + become: true \ No newline at end of file From 9fb92bff000301d024130d5fccdcf8c6972d5080 Mon Sep 17 00:00:00 2001 From: haraphat01 Date: Wed, 14 Jun 2023 05:29:15 -0700 Subject: [PATCH 36/36] updated the ansible file --- ansible/ANSIBLE.md | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/ansible/ANSIBLE.md b/ansible/ANSIBLE.md index c3236e976..7e5f145c9 100644 --- a/ansible/ANSIBLE.md +++ b/ansible/ANSIBLE.md @@ -1,23 +1,6 @@ -# Ansible - -This repository contains an Ansible playbook to deploy the Docker role. - -## Prerequisites - -Before running the playbook, you need to have Ansible installed on your system. - -## Usage - -To deploy the Docker role, run the following command: -ansible-playbook playbook.yml --diff - -The `--diff` option enables the diff mode, which shows the changes made by Ansible. - -## Inventory - -To list all the hosts in your inventory, run the following command: -PLAY [all] ********************************************************************* -skipping: no hosts matched - -PLAY RECAP ********************************************************************* - +WARNING]: Unable to parse +/home/pencil/Desktop/Work/DevOps/labss/ansible/inventory/default_aws_ec2.yml as +an inventory source +[WARNING]: No inventory was parsed, only implicit localhost is available +[WARNING]: provided hosts list is empty, only localhost is available. Note that +the implicit localhost does not match 'all' \ No newline at end of file