Ansible galaxy Role

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) it must produce (hello ansible user to ansible1.example.com on 192.168.137.200) and if i reload it the output should be (hello ansible user to ansible2.example.com on 192.168.137.201)

What is the question?

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) it must produce (hello ansible user to ansible1.example.com on 192.168.137.200) and if i reload it the output should be (hello ansible user to ansible2.example.com on 192.168.137.201))

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.

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.

I found this https://galaxy.ansible.com/dipuyadav/configure_httpd_with_haproxy_role, I never tried it myself, but you can take a look.

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

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