Professional Documents
Culture Documents
CA - 01 Automated Container Deployment and Administration
CA - 01 Automated Container Deployment and Administration
CA - 01 Automated Container Deployment and Administration
CA 01
Assessment Title
Professor
Kingsley Ibomo
Student Name:
Onkar Kshirsagar
Student No.
20023913
1
Summary:
This report outlines the deployment of the Apache service in a Docker container using
Ansible automation. The project aims to streamline container deployment and
administration processes to enhance efficiency and scalability in network
infrastructure.
As part of the deployment process, a public GitHub repository has been set up to
house Ansible playbooks, Docker files, and configuration files. Ansible automation is
utilized to install Docker, construct the Docker container with the Apache service, and
configure it to host a static web page. Additionally, network communication is enabled
within the Docker container, allowing accessibility from the host machine.
The results indicate that the Apache service has been successfully deployed and
made accessible within a Docker container. The network diagram illustrates the setup,
showing the container operating within the specified subnet and allowing traffic from
the host machine.
In conclusion, this project demonstrates the effectiveness of automation tools such as
Ansible and Docker in streamlining container deployment and administration tasks.
Automating these processes could potentially help organizations achieve greater
efficiency, reliability, and scalability in managing their network infrastructure. It is worth
considering future enhancements such as optimizing configurations, implementing
security measures, and exploring additional automation techniques for advanced
container management.
2
Content:
Introduction: ............................................................................................................. 4
Tools Introduction:................................................................................................ 4
Docker: ............................................................................................................... 4
Ansible: .............................................................................................................. 4
Apache server: ................................................................................................... 5
CentOS: .............................................................................................................. 5
GitHub Repository: ............................................................................................ 5
Steps for Automated Container Deployment and Administration: ...................... 5
Docker Container Deployment with Ansible:...................................................... 5
Configuration for Network Communication: ...................................................... 9
Verification of Accessibility: .................................................................................. 12
Network Diagram:................................................................................................... 13
Conclusions: .......................................................................................................... 14
References: ............................................................................................................. 14
Bibliography: .......................................................................................................... 14
3
Introduction:
Tools Introduction:
Docker:
Ansible:
4
Apache server:
Apache is a web server software that accepts HTTP requests and sends back the
requested information as web pages. This allows visitors to view content on your
website.
CentOS:
The CentOS Linux distribution is a platform that is known for its stability, predictability,
manageability, and reproducibility. It is derived from the sources of Red Hat Enterprise
Linux (RHEL). Our goal is to provide the necessary resources for other communities
to build on the CentOS Linux platform.
GitHub Repository:
A GitHub repository has been created to store the template file and resources
needed for deploying Docker containers with Ansible.
Ansible was utilized to deploy a Docker container that runs the Apache service (httpd)
with a static web page. The Ansible playbook comprises of tasks that involve pulling
the required Docker image, creating and initiating the container, and configuring the
Apache service with the specified static web page.
Two virtual machines were employed, both of which had Cent OS 7 installed.
One of the virtual machines was assigned as the controller node while the other was
designated as the managed node.
The controller node is identified as CentOS Slave, while the managed node is referred
to as CentOS Slave1.
Ansible has been installed on the controller node, and a playbook named
docker_conf.yml has been created to facilitate the deployment of a web server in a
Docker container using Ansible.
5
6
7
8
An index.HTML file has been created in the controller node to display the web page
in the browser. This file will be copied to the managed node via playbook and run
through the Apache webserver.
The Docker container has been configured to enable network communication. The
relevant network settings have been set up to ensure accessibility from the host
machine to the container subnet (172.168.10.0/30).
9
10
11
Verification of Accessibility:
Accessibility from the controller node to the managed node Docker container was
verified to ensure successful communication. Tests confirmed that the Apache web
service running within the container was accessible from the controller node.
The web page was accessed on the CentOS Linux machine, which is being used in a
virtual environment.
12
Network Diagram:
A network diagram has been created to illustrate the Docker container named
'apacher_container' running on the 172.168.10.0/30 subnet. The diagram shows traffic
allowance from the host machine to the container subnet, providing a visual
representation of the network configuration. Additionally, the GitHub repository is
connected to the host machine (controller node), and the managed node is connected
to the controller node via SSH using the ssh-keygen function and a public key.
13
Conclusions:
References:
https://docs.ansible.com/
https://www.youtube.com/watch?v=y2TSR7p3N0M&t=3094s
https://www.youtube.com/watch?v=OhnTMWmfTBE&t=9643s
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-
ansible-on-centos-7
Bibliography:
https://docs.ansible.com/ansible/2.9/dev_guide/developing_collections.html#:~:text=
You%20can%20publish%20collections%20to,the%20Galaxy%20docsite%20for%20
details.&text=Once%20you%20upload%20a%20version,delete%20or%20modify%2
0that%20version.
14