1. Creating a Docker Image with Python Using docker library to build an image: python import docker client = docker.from_env() # Dockerfile content dockerfile_content = “”” FROM python:3.9-slim WORKDIR [ … ]
Python commands for DevOps Phase 1
1. File Operations Read a file: python with open(‘file.txt’, ‘r’) as file: content = file.read() print(content) Write to a file: python with open(‘output.txt’, ‘w’) as file: file.write(‘Hello, DevOps!’) [ … ]
Ansible Interview Questions & Answers
Q1.Install and configure Ansible on the control-node control.realmX.example.com as follows: –> Install the required packages –> Create a static inventory file called /home/admin/ansible/inventory as follows: node1.realmX.example.com is a member of [ … ]
Ansible Project
LAMP Stack Setup and Web Application Deployment with Ansible 1. Playbook to Install and Configure Docker yaml — – name: Install and Configure Docker hosts: all become: yes tasks: – [ … ]
Ansible Phase 3
1. Playbook to Configure NTP (Network Time Protocol) yaml — – name: Configure NTP on Servers hosts: all become: yes tasks: – name: Install ntp package apt: name: ntp state: [ … ]
Ansible Phase 2
Ansible Playbooks 1. Simple Playbook to Install a Package yaml — – name: Install Nginx web server hosts: webservers become: yes tasks: – name: Install nginx package apt: name: nginx [ … ]
Ansible Phase 1
Ansible Definition Ansible is a powerful, open-source automation tool designed to streamline IT tasks such as configuration management, application deployment, and orchestration. Its core strengths are its simplicity, scalability, and [ … ]
Linux interview questions
Q1. What is Kernel Panic Error and How to troubleshoot it ? Explain step by step. Q2. How to reset Root user Password ? Q3. Explain Boot Process step by [ … ]
Linux scenario-based interview Questions & Answers Phase 2
1. How to set a username and password to NEVER EXPIRE? Ans: Command to check expiration date: chage -l username -l: Lists account aging information. Command to set account to [ … ]
Linux scenario-based interview Questions & Answers
*File System & Disk Management** 1. **Scenario**: `df` shows 100% disk usage, but `du -sh /` reports only 60% usage. What’s happening? **Fix**: `lsof +L1 | grep deleted` → Find [ … ]
