ARTH — Task 15 👨🏻‍💻

Role for Configuring HTTPD

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.

# ansible-galaxy role init my_http_role
# ansible-galaxy role list

🌟Now run main yml file http_role.yml :

Ansible role myloadbalancer to configure HAProxy LB.

Roles:

Roles let you automatically load related vars_files, tasks, handlers, and other Ansible artifacts based on a known file structure. Once you group your content in roles, you can easily reuse them and share them with other users

🌟Controller Node🌟

192.168.0.113 in this controller node we will config our Loadbalancer.

🌟Managed Node🌟

192.168.0.118 this managed node is our backed webserver .

# ansible-galaxy role init haproxy_role
# ansible-galaxy role init
webserver_role
# ansible-galaxy role list
# ansible-playbook haproxy_role.yml
systemctl status httpd

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store