# Ansible galaxy Role

**URL:** <https://forum.ansible.com/t/ansible-galaxy-role/36751>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [June 18, 2022, 12:03pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751 "2022-06-18T12:03:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahdi\_Idriss](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Mahdi\_Idriss](https://forum.ansible.com/u/Mahdi_Idriss)\
**Post date:** [June 18, 2022, 12:03pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/1 "2022-06-18T12:03:57Z")

</div>

Hello Mates, i have a question regarding ansible galaxy roles: i want to create a playbook that runs on hosts using balancer role, and this role create service to load balance web server requests between hosts in the webservers hosts, and if i browse the host ([http://ansible1.example.com](http://ansible1.example.com/)) it must produce (hello ansible user to [ansible1.example.com](http://ansible1.example.com/) on 192.168.137.200) and if i reload it the output should be (hello ansible user to [ansible2.example.com](http://ansible2.example.com/) on 192.168.137.201)

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 18, 2022, 2:04pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/2 "2022-06-18T14:04:17Z")

</div>

What is the question?

---

<div class="post-metadata">

**Author:** ![Mahdi\_Idriss](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Mahdi\_Idriss](https://forum.ansible.com/u/Mahdi_Idriss)\
**Post date:** [June 18, 2022, 3:21pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/3 "2022-06-18T15:21:35Z")

</div>

the question is mentioned above !! ( regarding ansible galaxy roles: i want to create a playbook that runs on hosts using balancer role, and this role create service to load balance web server requests between hosts in the webservers hosts, and if i browse the host ([http://ansible1.example.com](http://ansible1.example.com/)) it must produce (hello ansible user to [ansible1.example.com](http://ansible1.example.com/) on 192.168.137.200) and if i reload it the output should be (hello ansible user to [ansible2.example.com](http://ansible2.example.com/) on 192.168.137.201))

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [June 18, 2022, 3:36pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/4 "2022-06-18T15:36:32Z")

</div>

I agree, there is no question here really. unless your question is … “please give me the playbook”.  
Not sure whether such a request meets the nature of such a mailing list really though.

---

<div class="post-metadata">

**Author:** ![Paul\_Manno](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/paul_manno/32/2804_2.png) [@Paul\_Manno](https://forum.ansible.com/u/Paul_Manno)\
**Post date:** [June 18, 2022, 3:39pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/5 "2022-06-18T15:39:15Z")

</div>

Are you trying to write an ansible playbook that runs as a service to load balance backends? That’s not how ansible works. Sounds like you need a load balancer like nginx or haproxy.

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 18, 2022, 4:00pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/6 "2022-06-18T16:00:29Z")

</div>

I found this [https://galaxy.ansible.com/dipuyadav/configure\_httpd\_with\_haproxy\_role](https://galaxy.ansible.com/dipuyadav/configure_httpd_with_haproxy_role), I never tried it myself, but you can take a look.

---

<div class="post-metadata">

**Author:** ![Mahdi\_Idriss](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Mahdi\_Idriss](https://forum.ansible.com/u/Mahdi_Idriss)\
**Post date:** [June 18, 2022, 4:51pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/7 "2022-06-18T16:51:28Z")

</div>

Actually my question is from my last try for RHCE 294 Exam, and i was not able to solve it,  
anyway thanks for all of you

---

<div class="post-metadata">

**Author:** ![Rilindo\_Foster1](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Rilindo\_Foster1](https://forum.ansible.com/u/Rilindo_Foster1)\
**Post date:** [June 18, 2022, 4:56pm UTC](https://forum.ansible.com/t/ansible-galaxy-role/36751/8 "2022-06-18T16:56:57Z")

</div>

HI there,

You probably won’t get any direct answers on this, since Red Hat exams are under NDA. I will say that most tasks in question will provide enough detail that you should be able to complete the objective. So the next time you take the test, review environment and tasks carefully.

- Rilindo
