Skip to main content

Week 2: Refreshing Memories


Goals of the week

 - Understand the basics of networking  
- How to troubleshoot and manage networks in a DevOps context
- Basic Python programming and Using Python for automating DevOps tasks
- Use Ansible to automate different types of tasks, Configuration management ,pplication updation and OS configurations
- Get started with Git and Understanding of how it can be used in a DevOps context

Networking

Networking is a fundamental aspect of any distributed system. Networking in DevOps refers to the practice of managing, configuring, and maintaining the network infrastructure that connects and supports the various components and systems of a software development and deployment pipeline. This includes things like virtual networks, firewalls, load balancers, DNS servers, VPNs, and other network-related components.

A DevOps Engineer will be responsible for ensuring the network infrastructure is stable, secure, and available for all the components of the pipeline to communicate with each other.
Course: Networking Concepts and Protocols | Pluralsight.
Course expectation: Completion of Exercise.
Estimated time to complete this course: 1-2 days.

  • Learn: IPv4 Subnetting ** (CIDR Blocks), Public/DMZ, Private subnets.
  • Learn: How to create and manage virtual networks, virtual switches, and virtual NICs.
  • Learn: How to configure and manage a firewall using tools such as iptables or ufw. Practice creating and managing firewall rules to control incoming and outgoing network traffic.
  • Learn: How to use the ifconfig command to check and configure network interfaces, and the route command to check and configure routing tables.
  • Learn: How to use the ping command to check the reachability of a host and the traceroute command to check the route of a packet.
  • Learn: How to use the netstat command to check the status of network connections and opened ports.
  • Learn: How to use the tcpdump command to capture and analyze network packets.
  • Learn: How to use the iptables or ufw command to create and manage firewall rules.
  • Learn: How to set up and configure a VPN using OpenVPN, Wire Guard or another VPN software. Practice connecting to the VPN from a remote location and accessing resources on the internal network.
  • Learn: How to set up and configure a load balancer using HAProxy, NGINX or another load balancing software. Practice creating and managing load balancing rules and testing the load balancer's functionality.

Programming (Python)

Python is a popular programming language that is often used in DevOps because of its versatility and simplicity. Here are few reasons why Python is commonly used in DevOps:

  1. Automation
  2. Scripting
  3. Cross-platform compatibility
  4. Extensive libraries
  5. Easy to learn

In summary, Python's automation capabilities, scripting power, extensive libraries, cross-platform compatibility, community support, and ease of learning make it a great choice for DevOps engineers. It can help automate repetitive tasks, simplify complex processes, and integrate with various tools and services.

Book: Learn Python Reference Book.
Expectation: Attempt exercises are from 30 to 44; exclude web development exercises.
Estimated time to complete this course: 2-3 days.

  • Task: Write a python client-server application program that, where the client is able to download a file from the server
  • Task: Write a Python script that automates the process of logging into a remote server using SSH. The script should be able to connect to the server, run a command, and print the output.
  • Task: Write a Python script that automates the process of creating and deleting a file on a remote server. The script should be able to connect to the server, create or delete the file, and print the status.
  • Task: Write a Python script that automates the process of creating and deleting a user on a remote server. The script should be able to connect to the server, create or delete the user, and print the status.
  • Task: Write a Python script that automates the process of copying files from one server to another. The script should be able to connect to the servers, copy the files, and print the status.

Version control (GIT)

Course: Basic Course: How Git Works | Advanced Course: Mastering Git
Course expectation: Revision
Estimated time to complete this course: 1-2 days

  • Learn: How to create and switch between branches in a Git repository. Create a new branch, make some changes, and merge the changes back into the master branch.
  • Learn: How to use Git to collaborate with others. Clone a remote repository, make some changes, and submit a pull request to have your changes reviewed and merged by a collaborator.
  • Learn: How to use Git to manage a continuous integration and continuous delivery (CI/CD) pipeline. Create a Git repository and configure it to trigger builds and deployments when changes are pushed to the repository.
  • Learn: How to use Git hooks to automate tasks. Create a pre-commit hook that runs a linter to check for code style issues before allowing a commit to be made.
  • Learn: How to use Git stash to save and restore changes that you don't want to commit yet.
  • Learn: How to use Git bisect to find the commit that introduced a bug in the codebase.
  • Learn: How to use Git merge to combine multiple branches, understanding different merge strategies and how to resolve conflicts.
  • Learn: How to use Git tags to mark specific versions of the codebase, and how to use Git describe to identify the version of the codebase
  • Learn: How to use Git blame to see who made the changes and when they were made in the codebase

Ansible

Ansible is an open-source automation tool that is often used in DevOps to automate the deployment and management of software and systems. Ansible works by using a simple, human-readable language called YAML to define "playbooks" that describe the desired state of a system. These playbooks are executed by Ansible, which then makes the necessary changes to the system to bring it into compliance with the defined state.

Course: Basic Course: Ansible Fundamentals | Pluralsight | Advanced Course: Testing and Debugging Ansible Automation | Pluralsight
Course expectation: Best Effort
Estimated time to complete this course: 2-3 days

  • Task: Create a playbook that installs and configures a web server (e.g. Apache or Nginx) on a remote host.
  • Task: Create a playbook that creates a new user on multiple remote hosts.
  • Task: Create a playbook that updates all packages on a remote host.
  • Task: Create a playbook that configures a remote host as a load balancer using HAProxy.