# Update the port of server.xml file in Tomcat via ansible

**URL:** <https://forum.ansible.com/t/update-the-port-of-server-xml-file-in-tomcat-via-ansible/35431>\
**Category:** Ansible Project\
**Created:** [June 28, 2021, 10:30pm UTC](https://forum.ansible.com/t/update-the-port-of-server-xml-file-in-tomcat-via-ansible/35431 "2021-06-28T22:30:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajaniesh\_Kaushikk](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rajaniesh\_Kaushikk](https://forum.ansible.com/u/Rajaniesh_Kaushikk)\
**Post date:** [June 28, 2021, 10:30pm UTC](https://forum.ansible.com/t/update-the-port-of-server-xml-file-in-tomcat-via-ansible/35431/1 "2021-06-28T22:30:26Z")

</div>

Hi,

I am very new to Ansible and I need small help top update the p[ort number in the server.xml file in tomcat to change the port from 8080 to 8090 here is the server.xml (highlighted in bold)

--------------------------------Server.xml---------------------

\<?xml version="1.0" encoding="UTF-8"?\>

----------------------Server.xml-------------------

Regards  
Rajaniesh

---

<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 29, 2021, 3:32am UTC](https://forum.ansible.com/t/update-the-port-of-server-xml-file-in-tomcat-via-ansible/35431/2 "2021-06-29T03:32:13Z")

</div>

[https://docs.ansible.com/ansible/latest/collections/community/general/xml\_module.html](https://docs.ansible.com/ansible/latest/collections/community/general/xml_module.html)
