# Multiple tomcat service on same server with ports

**URL:** <https://forum.ansible.com/t/multiple-tomcat-service-on-same-server-with-ports/30678>\
**Category:** Ansible Project\
**Created:** [June 27, 2019, 8:16pm UTC](https://forum.ansible.com/t/multiple-tomcat-service-on-same-server-with-ports/30678 "2019-06-27T20:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajay\_Prajapati](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Ajay\_Prajapati](https://forum.ansible.com/u/Ajay_Prajapati)\
**Post date:** [June 27, 2019, 8:16pm UTC](https://forum.ansible.com/t/multiple-tomcat-service-on-same-server-with-ports/30678/1 "2019-06-27T20:16:05Z")

</div>

Hi,  
I have multiple applications to run on multiple tomcat on Sami server.. I have playbook to install tomcat, I have to run the same playbook with different variables for ports  
Like for example var=8080, var=8090, etc

Hope my question is understandable,  
Quick help will be helpful

Regards, Ajay

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 27, 2019, 10:00pm UTC](https://forum.ansible.com/t/multiple-tomcat-service-on-same-server-with-ports/30678/2 "2019-06-27T22:00:39Z")

</div>

No, because you didn't ask any.  
So, what is your question?  
Please be very specific, and show playbooks, variables, etc.

thx

---

<div class="post-metadata">

**Author:** ![David\_McCheyne](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@David\_McCheyne](https://forum.ansible.com/u/David_McCheyne)\
**Post date:** [June 28, 2019, 4:25am UTC](https://forum.ansible.com/t/multiple-tomcat-service-on-same-server-with-ports/30678/3 "2019-06-28T04:25:33Z")

</div>

I’m pretty sure you mean to ask “ **DO** I need to run the same playbook with different variables for ports”? And it sounds like you’ve got a working play that acts on the port given to ‘var’.  
If that’s it, then yes that is your easiest solution without changing your code. Call the play once with each value. Since it’s an install play, that might be fine. But if it’s also got for instance a start/stop play  
then that not very elegant, or efficient, so you could instead run a with\_items loop over ‘var\_list’, where ‘var\_list’ will be a list of ports to act on.

Good Luck! If you need more help, show us your code. 🙂
