"Automating Apache HTTPD Installation on Windows with Ansible: A Step-by-Step Guide"

ReshmaReshma
1 min read

Before you begin:
Ensure you have set up password-less SSH authentication between your Ansible control node and the target server. If you haven't done this yet, follow the step-by-step guide here to get it configured.

Create a File with .yml or yaml extension into the ansible instance

---
- name: Install and Start HTTPD Service
  hosts: all
  become: true

  tasks:
    - name: Install HTTPD Package
      apt:
         name: apache2
         state: present

    - name: Start HTTPD Service
      service:
             name: apache2
             state: started

Run the file

ansible-playbook -i inventory fileName.yml

Playbook Output

Check for HTTPD Installation

sudo systemctl status apache2

HTTPD Output

You are done installing HTTPD Package on Windows”

Command To Stop the HTTPD

sudo systemcd stop apache2

Check if the HTTPD is Stopped

sudo systemcd status apache2

Status Of HTTPD Service Stop

HAPPY AUTOMATING !

0
Subscribe to my newsletter

Read articles from Reshma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Reshma
Reshma

I'm an enthusiastic student investigating the dynamic area of DevOps, where I enjoy creating initiatives that combine technology with efficiency. My creative side shines through in design, as I use tools like Canva and Figma to bring ideas to life. I'm all about learning, experimenting, and closing the gap between automation and design.