Skip to content

seyyeDevops/interview_tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interview Tasks

This repository contains Ansible playbooks and roles for setting up Docker, Nginx, and Rsyslog services. The project is structured to automate the deployment and configuration of these services using Ansible.

Project Structure

Ansible Configuration

Playbooks

Roles

Docker Setup

Explanation: This role installs Docker on the target machine, configures it using the provided settings, and ensures that the Docker service is running.

Nginx

Explanation: This role installs Nginx on the target machine, configures it using the provided settings, and ensures that the Nginx service is running.

Rsyslog Service

Explanation: This role installs Rsyslog on the target machine, configures it using the provided settings, and ensures that the Rsyslog service is running.

Scripts

  • rpm_nginx.sh: Shell script for RPM-based Nginx installation.

Task2

Explanation: This directory contains additional configurations and scripts for setting up a logging infrastructure using Docker Compose, Logstash, and Rsyslog.

Docker Compose

  • compose.yml: Defines the services, networks, and volumes for the logging infrastructure. It includes configurations for Logstash and Rsyslog containers.

Explanation: This file orchestrates the deployment of multiple Docker containers, ensuring they are correctly configured and connected.

Dockerfile

Explanation: This file contains the instructions to build a Docker image for Rsyslog, including installing necessary packages and copying configuration files.

Configuration Files

Explanation: This file contains the configuration settings for Rsyslog, defining how logs are processed and where they are stored.

Systemd Service

Explanation: This file defines a systemd service for the log sender script, ensuring it runs as a background service.

Shell Script

Explanation: This script is responsible for sending logs to a specified destination. It is executed by the systemd service.

Usage

  1. Clone the repository:

    git clone https://github.com/yourusername/interview_tasks.git
    cd interview_tasks
  2. Update the inventory file hosts.yml with your server details.

  3. Run the desired playbook:

    ansible-playbook -i hosts.yml playbooks/nginx.yml

Note

To use the ftp server on /var/log:

lftp ftp://rsyslog:StrongPassword1@ip

Data Life Cycle:

Hot Phase
Indices are kept in the hot phase for up to 7 days or until they reach 50GB in size.
Once these conditions are met, the index rolls over to a new index, allowing new data to continue being stored efficiently.
Warm Phase
After 7 days, the index transitions to the warm phase.
In this phase, the index undergoes a forcemerge to reduce the number of segments to 1. This helps reduce disk space usage and optimizes the index for read operations.
Delete Phase
After 180 days, the index enters the delete phase.
In this phase, the index is deleted to free up storage space, ensuring efficient use of system resources.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published