Create an ansible role myapache to configure WebServer.

Mihir Patel
Jan 6, 2021

Role: In Ansible, the role is the primary mechanism for breaking a playbook into multiple files. This simplifies writing complex playbooks, and it makes them easier to reuse.

in this article my managed node is 127.0.0.1 :

Creating the role in Controller node and setup Path in Inventory File :

Here i create the my_http_role under the roles folder :

Setup roles Path :

🔹Creating an ansible role my_http_role:

# ansible-galaxy role init my_http_role

🔹For see how many role in your pc :

# ansible-galaxy role list

🔹For configuring server using my_http_role:

🔹Put Task in Main.yml file :

🌟Now run main yml file http_role.yml :

🔹Let’s check our webpage from the browser :

Successfully Run ….

Thanks for reading !!!😊✨

--

--