DevOps Project – Complete auto deployment and IAAC

The following project having these requriment:-

  • I want to have a CI/CD pipeline for my application the pipeline must build and test the application code base.
  • The pipeline must build and push a Docker container ready to use.
  • The pipeline must deploy the application across different environments on the target infrastructure.
  • Separate the backend and the frontend in different pipelines and containers.

Another Things to add to this project which is the follwong :-

  • the infrastructure must be created on the cloud, for the purpose of the assignment any public cloud can be used.
  • The deployment pipeline must use infrastructure as code using Terraform
  • The delivered infrastructure must be monitored and audited.
  • The delivered infrastructure must allow multiple personal accounts.
  • The delivered infrastructure must be able to scale automatically.
  • Modify the application to make use of real database running on the cloud, instead of the in-memory database.

The Link for the Project HERE

Enjoy the automation

Osama

ansible provisioning for instance (Cloud Version) Using Pipelines

Imagine you are having multiple instances and you want to change something, if you will do this manually it will take time from you why not to automte the process ?

I upladed one of the projects to automate the process, this will allow to automate the simplest things for example new employee joined and you need to add his SSH key to your instances (You can even choose which VM you want to him/her to acces) , just add the key in the roles and configure the pipeline on your rep and the code will run Automtically.

I uploaded the project on my github HERE.

Ragards

Enjoy the power of automation.

Osama

Ansible : Invalid/incorrect password: Permission denied, please try again

Trying to work with ansible and got the below error

The inventory having the following line :-

target1 ansible_host=192.168.204.129  ansible_ssh_pass=password

When trying to run a test like the below :-

osama@ansible-controller:~/ansible_test$ ansible target1 -m ping -i /home/osama/ansible_test/inventory.txt

The following error appeared :-

target1 | UNREACHABLE! => {

    "changed": false,

    "msg": "Invalid/incorrect password: Permission denied, please try again.",

    "unreachable": true

}

To solve this error you need to set the right username and password like the following, inside the inventory add the following :-

target1 ansible_host=192.168.204.129  ansible_ssh_user=osboxes aniansible_ssh_pass=password

Run the test again by :-

osama@ansible-controller:~/ansible_test$ ansible target1 -m ping -i /home/osama/ansible_test/inventory.txt  --ask-pass

The output will be

target1 | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python3"

    },

    "changed": false,

    "ping": "pong"

If you want pre-defined VMware or virtual box you can download from HERE

Enjoy

Osama

Docker Compose example

In this post i choose this topic – Docker compose, i will upload the files gradually till the project will be working and met my requriemnt 100%.

This project will be like the following

  • 2 application, i used php.
  • 1 nginx as load balancer
  • 1 database , i choose mysql version 8.

This project will be fully bulit on Docker compose, i tried to make simple as much as i can so the people will understand the concept.

The Project HERE.

Remember i will keep upload the files for this project will i will make sure it’s 100% meet my reqruiment but for now i uploaded the compose and enviroment variable.

Enjoy

Osama

Docker & kubernetes example – Full project for free

Okay, I love to post free examples/projects on my github from while to while, i choose docker and kubernetes this time, the project idea it’s very nice and easy to implement.

What this project do ?

This can be a simple web app that reads a ‘hello world’ string from the MySQL database.Run a database app. Data volume should be persistent.Application from step 1 needs to discover the database from step 2 using Kubernetes native features.
Database credentials should NOT be hardcoded in application or helm chart code.The application should be accessible from the outside of Kubernetes.Create a helm chart which implements all these steps

  • Create an application that connects to a database, reads some data, and returns this data upon HTTP request, This can be a simple web app that reads a ‘hello world’ string from the MySQL database.
  • Run a database app. Data volume should be persistent.
  • Application from step 1 needs to discover the database from step 2 using Kubernetes native features, Database credentials should NOT be hardcoded in application or helm chart code.
  • The application should be accessible from the outside of Kubernetes.
  • Create a helm chart which implements all these steps

I Choose to use Java as programing language because the springboot framework it’s already defined and easy to use.

Please follow the readme file and everything will working fine without any issue, if you have any question comment below and i will answer

GitHub Link HERE

Enjoy the free learning

Osama

DevOps Overview, Cloud Version this time Azure

DevOps is the union of people, process, and products to enable continuous delivery of value to your end users. Azure DevOps is a set of services that gives you the tools you need to do just that. With Azure DevOps, you can build, test, and deploy any application, either to the cloud or on premises. DevOps practices that enable transparency, cooperation, continuous delivery and continuous deployment become embedded in your software development lifecycle.

Azure DevOps provides several tools you can use for better team collaboration. It also has tools for automated build processes, testing, version control, and package management. That’s quite a bit to cover! We’ll get to all the tools eventually. For now, let’s follow the team as they begin with an overview of what Azure DevOps is and how they can get started.

Azure DevOps ServicesDescriptions
Azure Boardsagile tools that help us plan, track, and discuss our work, even with other teams.
Azure Pipelines build, test, and deploy with CI/CD that works with any language, platform, and cloud.
Azure Test Plansmanual and exploratory testing tools.
Azure Reposprovide unlimited, cloud-hosted private, and public Git repos.
Azure Artifacts create, host, and share packages.

What is Agile?

Agile is a term that’s used to describe approaches to software development, emphasizing incremental delivery, team collaboration, continual planning, and continual learning. Agile isn’t a process as much as it is a philosophy or mindset for planning the work that a team will do. It’s based on iterative development and helps a team better plan for and react to the inevitable changes that occur in software development. Let’s listen in on Mara’s discussion with Andy after the latest release.

Recommendations for adopting Agile

  • Create an organizational structure that supports Agile practices
  • Mentor team members on Agile techniques and practices
  • Enable in-team and cross-team collaboration:- If collaboration is the key to becoming successful at Agile, what are some of the ways you can encourage it? Here are some ideas.

What is Azure Boards?

Azure Boards is a tool in Azure DevOps to help teams plan the work that needs to be done. The Tailspin team will use this tool to get a better idea of what work needs to be done and how to prioritize it.

Set up Azure Boards using the Basic process

  • Create the project
  1. Sign into your account at dev.azure.com.
  2. Select + Create project.
  3. In the Project name field, type Space Game – web.
  4. In the Description field, type The Space Game website.
  5. Under Visibility, you choose whether to make your project public or private. For now, you can choose private.
  6. Select Advanced.
  7. Under Version control, make sure that Git is selected. Under Work item process, make sure that Basic is selected.
  8. Select Create.
  • Create a team
  1. Select Project settings in the lower-left corner.
  2. On the Project details page, under General, select Teams.
  3. Select Space Game – web Team.
  • Add team members
  1. Under Members, select + Add.
  2. Enter the email address of the user you’d like to add. Then select Save changes.
  3. Repeat the process for any other members you’d like to add.
  • Create the board
  1. In the column on the left, point to Boards and select Boards from the menu that appears.
  2. Select Space Game – web Team boards. A blank board appears.
  3. In the To Do column, select the green + button next to the New item field.
  4. Enter Stabilize the build server and then press Enter.
  5. Select the ellipsis (), and then select Open.
  6. In the Description field, enter this text (The build server keeps falling over. The OS, Ubuntu 16.04, requires security patches and updates. It’s also a challenge to keep build tools and other software up to date.)
  7. Select Save & Close.
  8. Follow the same steps for the next two items.
TitleDescription
Create a Git-based workflowMigrate source code to GitHub and define how we’ll collaborate.
Create unit testsAdd unit tests to the project to help minimize regression bugs.

Drag Stabilize the build server to the top of the stack. Then, drag Create a Git-based workflow to the second item position. Your final board looks like this.

  • Define a sprint
  1. In the left-side column, select Sprints.
  2. Select Set dates from the upper right.
  3. Leave the name as Sprint 1.
  4. In the Start date field, select the calendar and pick today’s date.
  5. In the End date field, select the calendar and pick the date two weeks from today.
  6. Select Save and Close.

Assign tasks and set the iteration

  1. Under Boards, select Work items.
  2. Select Stabilize the build server.
  3. In the Iteration drop-down list, select Sprint 1.
  4. From the same window, select Unassigned and set yourself as the task owner.
  5. Repeat the process for the other two work items.
    1. Create a Git-based workflow
    2. Create unit tests

Cheers
Osama

integrate jenkins with github “Method POST required” Error

This post for error trying to integrate Jenkins with github, i will post about that for sure as video and Blog post, but for this error i will like the following :-

This is when you try to to do any changes from the github side, it’s not reflecting on Jenkins side, this is simple because of the webhook (payload) not including the “/” at the end

it should be like the below :-

Add “/” at the end of your Payload URL

Cheers

Osama

Auto Closing Trigger in Zabbix

There are different problems category in zabbix which is like the below:-

  • Disaster
  • High
  • Average
  • Warning
  • Information
  • Not classified

I will focus in this post on Information and Not Classified Issues.

These two Problem category to inform users about some change in the operating system for example, such as Updating the operating system, or You have CPU utilization, this is not the issue, the problem with these two category they never disappeared from Zabbix Dashboard, and to be honest for me it’s annoying 😅

Therefore, i was trying to find a way to hide these issues, i don’t want to disabled the trigger because in that case it will never appeared and this is not the goal for me,I just want them to be on Dashboard for certain amount of time.

I found two ways for that after investigation, the one will be done from Database level, for example MySQL in my case, the other one via Zabbix Dashboard ( Trigger part) this is the right one and what i want.

Method #1 

To fix this issue from the database , you have to follow the below : –

  • You should have access to MySQL
  • Use Zabbix Database
  • Knowledge of database and Zabbix table, you don’t want to corrupt the database.
  • there are different tables we need to deal with
triggers table
problem table
alerts table
  • You have to know, inside trigger table value column contains two number which 0 (you don’t have any error) and 1 (you have problem)
select * from triggers where description like '%Operating%' and value = 1;
update triggers set value = 0 where  description like '%Operating%' and value = 1;

The above Select search for trigger called Operating system and the trigger should have issue, then update this trigger to 0 to assign this issue to ok.

Method #2

This method i preferred but i had to mentioned the previous one so in case someone wants to use it, in this one you don’t have to access to the database at all.

  • From The upper panel –> Choose configuration –> Host –> search for your host –> Press on Trigger –> Search for the trigger.
  • Once you press on the trigger you want, it will show couple of Options , we will care only about “problem expression”
  • From problem expression press add button and choose the item that related to this trigger.
  • There is Function inside the zabbix ( Built-in) called nodata takes second as parameter, you can put the item and choose the function then set the time for 10 sec same as the below picture.

Enjoy 👊

Cheers 🍻

Osama