Skip to content

Commit

Permalink
fix search bar dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pandeyji711 committed Jun 5, 2024
2 parents 9fb0e33 + c79bc4d commit 6e8b892
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 44 deletions.
12 changes: 12 additions & 0 deletions Ansible Httpd Docker/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[defaults]
inventory = /home/ec2-user/ansible/inventory
roles_path = ~/.ansible/collections:/usr/share/ansible/roles:/home/ec2-user/ansible/roles
collections_path = ~/.ansible/roles:/usr/share/ansible/roles:/home/ec2-user/ansible/mycollection
ask_pass = false
host_key_checking = false

[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false
54 changes: 54 additions & 0 deletions Ansible Httpd Docker/docker_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
- name: Configure and Run Docker Container
hosts: dev # Use the group name from your inventory file
remote_user: ec2-user # SSH username for connecting to the EC2 instance
become: yes
become_method: sudo
tasks:
- name: Install Docker on Amazon Linux 2
ansible.builtin.package:
name: docker
state: present

- name: Start and enable Docker service
ansible.builtin.service:
name: docker
state: started
enabled: yes

- name: Pull the httpd server image from Docker Hub
community.docker.docker_image:
name: httpd:latest
source: pull

- name: Create /var/www/html directory
ansible.builtin.file:
path: /var/www/html
state: directory

- name: Create an HTML file
ansible.builtin.copy:
content: "<html><body><h1>Hello, Azfar this side from Arth3. 0</h1></body></html>"
dest: /var/www/html/index.html

- name: Remove the existing container if it exists
community.docker.docker_container:
name: my_httpd_container
state: absent
ignore_errors: yes

- name: Run the Docker container
community.docker.docker_container:
name: my_httpd_container
image: httpd:latest
ports:
- "8080:80"
volumes:
- /var/www/html:/usr/local/apache2/htdocs/
state: started

handlers:
- name: Reload Apache
ansible.builtin.service:
name: httpd
state: reloaded
72 changes: 72 additions & 0 deletions Ansible Httpd Docker/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apache Web Server</title>
<style>
/* Global styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #dc31e8;
text-align: center;
}

/* Header styles */
header {
background-color: #00FFFF;
color: #333;
padding: 20px;
border-bottom: 5px solid #333;
}

h1 {
font-size: 36px;
margin: 0;
}

/* Content styles */
.content {
padding: 20px;
}

p {
font-size: 18px;
color: #666;
line-height: 1.6;
}

/* Image styles */
img {
max-width: 100%;
height: auto;
border: 5px solid #fff;
border-radius: 10px;
}

/* Link styles */
a {
color: #101516;
text-decoration: none;
font-weight: bold;
}

a:hover {
color: #FFFFFF;
}
</style>
</head>
<body>
<header>
<h1>Welcome to the Apache Web Server!</h1>
</header>
<div class="content">
<h1><p><span style="font-weight: bold; font-size: 1.2em; color: black;"> <a href="https://www.linkedin.com/in/mayank-sharma-devops"> This is Mayank Sharma of Arth team 18 and this is a project of ansible playbook</a></span></p></h1>
<p>For more information, visit the <a href="https://www.linkedin.com/posts/mayank-sharma-devops_linkedintechcommunity-dockerwebservermagic-activity-7093840628077268993-xL-S?utm_source=share&utm_medium=member_desktop">Apache HTTP Server Project</a>.</p>
<!-- Inserting the Apache web server image -->
<img src="https://ubunlog.com/wp-content/uploads/2022/03/Apache-1024x483.jpg" alt="Apache Web Server">
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions Ansible Httpd Docker/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[dev]
host IP # replace ip of your slave node
141 changes: 141 additions & 0 deletions Ansible Httpd Docker/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Ansible Playbook for Configuring HTTPD inside Docker

This repository contains an Ansible playbook to set up an HTTPD (Apache) server inside a Docker container. By following the steps in this guide, you can easily install and configure the Apache server in a Docker container. The playbook automates everything from installing Docker and HTTPD to configuring the server and running the container.



https://github.com/mayaworld13/HelpOps-Hub/assets/127987256/15e3429d-9e79-48a5-a98d-14120711402c



## Steps

### 1. Install Ansible
Install Ansible on your master node:
```sh
sudo yum install ansible-core -y
```

### 2. Create an Ansible Directory
Create a directory for your Ansible configuration and navigate into it:
```sh
mkdir ansible
cd ansible
```

### 3. Configuration with ansible.cfg
Create the Ansible configuration file:

```sh
vim ansible.cfg
```
Paste the following content into `ansible.cfg`:

```sh
[defaults]
inventory = inventory
```

### 4. Create an Inventory File
Create an inventory file and add the IP address of your `slave node`:

```sh
vim inventory
[webservers]
<slave_node_ip> ansible_connection=ssh ansible_user=<your_user>
```

### 5. Establish Password Access
Ensure passwordless SSH access from the master node to the slave node. You can do this by copying the `SSH` key:

```sh
ssh-copy-id <your_user>@<slave_node_ip>
```

### 6. Verify Connectivity
Verify that the Ansible master node can connect to the slave node:

```sh
ansible all -m ping
```

### 7. Create the Playbook File
Create the playbook file docker.yml:

```sh
vim docker.yml
```
Paste the following content into `docker-playbook.yml`:

```sh
---
- name: Configure and Run Docker Container
hosts: dev # Use the group name from your inventory file
remote_user: ec2-user # SSH username for connecting to the EC2 instance
become: yes
become_method: sudo
tasks:
- name: Install Docker on Amazon Linux 2
ansible.builtin.package:
name: docker
state: present

- name: Start and enable Docker service
ansible.builtin.service:
name: docker
state: started
enabled: yes

- name: Pull the httpd server image from Docker Hub
community.docker.docker_image:
name: httpd:latest
source: pull

- name: Create /var/www/html directory
ansible.builtin.file:
path: /var/www/html
state: directory

- name: Create an HTML file
ansible.builtin.copy:
content: "<html><body><h1>Hello, Azfar this side from Arth3. 0</h1></body></html>"
dest: /var/www/html/index.html

- name: Remove the existing container if it exists
community.docker.docker_container:
name: my_httpd_container
state: absent
ignore_errors: yes

- name: Run the Docker container
community.docker.docker_container:
name: my_httpd_container
image: httpd:latest
ports:
- "8080:80"
volumes:
- /var/www/html:/usr/local/apache2/htdocs/
state: started

handlers:
- name: Reload Apache
ansible.builtin.service:
name: httpd
state: reloaded
```
### 8. Validate the Playbook
Validate your playbook to ensure there are no errors:
```sh
ansible-playbook --syntax-check docker.yml
```
### 9. Run the Playbook
```sh
ansible-playbook docker-playbook.yml
```
24 changes: 18 additions & 6 deletions Official_Website/contributor-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
<header class="header">

<div class="logo">
<a href="https://helpops-hub.vercel.app/"
><img src="logo.png" alt="HelpOps-Hub Logo"
/></a>
<img src="logo.png" alt="HelpOps-Hub Logo">
</div>
<div>

Expand Down Expand Up @@ -74,6 +72,15 @@ <h1>HelpOps-Hub</h1>
<li class="nav__item">
<a href="javascript:void(0);" class="fas fa-adjust" onclick="toggleTheme()"></a>
</li>
<li>
<button class="about-button">

<a href="./about.html">
About Us
</a>
</button>

</li>
<li><button class="about-button">

<a href="./faq.html">
Expand All @@ -90,6 +97,7 @@ <h1>HelpOps-Hub</h1>

</nav>
<div class="container">
<main class="main-content">
<div class="intro">
<h1>Our Team</h1>
<p>
Expand All @@ -100,6 +108,7 @@ <h1>Our Team</h1>
</div>
<div id="team-grid">
<div class="team-member">
<div class="card">
<div class="image-div">
<img src="Screenshot (251).png" alt="Azfar Alam" />
</div>
Expand All @@ -108,6 +117,7 @@ <h1>Our Team</h1>
<h2>Azfar Alam</h2>
<p>DevOps Engineer</p>
</div>
</div>
<div id="social-links">
<a href="https://github.com/sponsors/mdazfar2"><i class="fas fa-heart"></i> Sponsor</a>
<a href="https://github.com/mdazfar2"><i class="fab fa-github"></i> GitHub</a>
Expand All @@ -116,8 +126,8 @@ <h2>Azfar Alam</h2>
<span class="badge founder">Founder</span>

</div>
<div class="team-member2">

<div class="team-member">
<div class="card">
<div class="image-div">
<img src="Screenshot (250).png" alt="Anurag Pandey" />
</div>
Expand All @@ -126,6 +136,7 @@ <h2>Azfar Alam</h2>
<h2>Anurag Pandey</h2>
<p>Software Engineer</p>
</div>
</div>
<div id="social-links">
<a href="https://github.com/sponsors/pandeyji711"><i class="fas fa-heart"></i> Sponsor</a>
<a href="https://github.com/pandeyji711"><i class="fab fa-github"></i> GitHub</a>
Expand All @@ -134,6 +145,7 @@ <h2>Anurag Pandey</h2>
<span class="badge founder">Maintainer</span>
</div>
</div>
</main>
</div>
<button id="scrollToTopBtn" class="scrollToTopBtn"></button>
<div id="team-grid1">
Expand Down Expand Up @@ -480,4 +492,4 @@ <h2>Anurag Pandey</h2>
<script src="contributor.js"></script>
<script src="dark_mode.js"></script>
</body>
</html>
</html>
Loading

0 comments on commit 6e8b892

Please sign in to comment.