Task-14.2

Task-14.2

Ansible playbook that will retrieve new Container IP and dynamically update the inventory and Configure web-server inside that Docker Container

Task Description??

?? 14.2 Further in ARTH — Task 10 have to create an Ansible playbook that will retrieve new Container IP and update the inventory. So that further Configuration of Webserver could be done inside that Container.

Lets get started

In this task I have used my own pre-created docker image which is enabled with ssh. So that Ansible can use ssh protocol to login to new docker container and configure webserver inside it.

In my case I am having Controller Node having IP 192.168.43.155 on which the ansible is installed

Lets check the ansible version installed on my controller node :

No alt text provided for this image

Initially inventory file is empty

No alt text provided for this image

Configuration file of ansible :

No alt text provided for this image

Ansible Playbook :

No alt text provided for this image
No alt text provided for this image

dockerip.txt file

No alt text provided for this image

task14.2-html file

No alt text provided for this image

Now let’s run the main Playbook:

No alt text provided for this image

 Inventory file dynamically updated

No alt text provided for this image

 Check Docker Service started and enabled:

No alt text provided for this image

 Successfully Launched docker container with name myweb:

No alt text provided for this image

 Now we can run our docker-web.yml playbook to configure webserver inside container:

No alt text provided for this image

Done! Now checking by Attaching to myweb container:

No alt text provided for this image

Now the webserver has been deployed on the docker container with the help of the Ansible Automation tool. So Let’s check our webpage from the browser :

No alt text provided for this image

Thanks!!

要查看或添加评论,请登录

Akanksha Bhatt的更多文章

  • Task-8 Automation with Python

    Task-8 Automation with Python

    ARTH - Task 8 ??????? Task Description?? ?? Create a Menu Using Python integrating all the concepts that have been…

  • Task-14.3

    Task-14.3

    ???????? ?????????????????????? : Create an Ansible Playbook which will dynamically load the variable file named same…

  • Task-14.1

    Task-14.1

    Task description :- 14.1 Create a network Topology Setup in such a way so that System A can ping to two Systems System…

  • LOAD BALANCING WITH HAPROXY

    LOAD BALANCING WITH HAPROXY

    Task Description 12.1 Use Ansible playbook to Configure Reverse Proxy i.

    1 条评论
  • ARTH TASK-15

    ARTH TASK-15

    Task Description?? Create an ansible role myapache to configure Httpd WebServer. Create another ansible role…

    1 条评论
  • Neural Networks in Netflix

    Neural Networks in Netflix

    What are Neural Networks? Neural networks are a set of algorithms, they are designed to mimic the human brain, that is…

  • Restarting HTTPD Service is not idempotent in nature and also consume more resources suggest a way to rectify this challenge in Ansible Playbook.

    Restarting HTTPD Service is not idempotent in nature and also consume more resources suggest a way to rectify this challenge in Ansible Playbook.

    What is Idempotent nature in Ansible? An operation is idempotent if the result of performing it once is exactly the…

  • CONFIGURING HADOOP CLUSTER USING ANSIBLE

    CONFIGURING HADOOP CLUSTER USING ANSIBLE

    Welcome you all, in this blog I will cover how we can“ CONFIGURE HADOOP CLUSTER USING ANSIBLE” Before starting the…

    1 条评论
  • How Industries are Solving Challenges Using Ansible??

    How Industries are Solving Challenges Using Ansible??

    What Is Ansible ? ?? Ansible is a software tool that provides simple but powerful automation for cross-platform…

  • Configuration of Apache Web Server in Docker Container using Ansible

    Configuration of Apache Web Server in Docker Container using Ansible

    In this article we will perform various tasks: Configure Docker Start and enable Docker Services Pull the httpd server…

    1 条评论

社区洞察

其他会员也浏览了