Building a project to launch automatically website having configured OS with configured Apache webserver use source code from GitHub

Building a project to launch automatically website having configured OS with configured Apache webserver use source code from GitHub

Introduction:

This documentation outlines the steps to use our automated website deployment project. The project aims to simplify the process of launching websites by automating the setup of a configured operating system (OS) with Apache webserver, while also integrating source code from GitHub repositories seamlessly.

Prerequisites:

  • Access to a server or virtual machine with internet connectivity.

  • Basic understanding of Linux operating system and command-line interface.

  • GitHub account with the repository containing your website source code.

Step 1: Install git with yum install git .

Step 2:Install ansible with yum install ansible .

Step 3: Create a yml file and write this code


---
- name: Fetch and run playbook from GitHub
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Clone Ansible playbook repository from GitHub
      git:
        repo: https://github.com/aravrider/aman.git
        dest: /home/ec2-user/amanjit

    - name: Run the fetched playbook
      command: ansible-playbook /home/ec2-user/amanjit/main.yml

Run playbook with ansible-playbook file_name.yml.