Unless you are planning on updating your tomcat version very frequently, it might be simpler to use `template` module to substitute in the port number. We have a few other custom changes in our server.xml so it made sense for us. I'd recommend keeping the unmodified server.xml around in your ansible role somewhere so that you have something to compare to when you do eventually update your tomcat version.
If you still want to manipulate the xml you can probably pick it out using an attribute like this /Server/Service/Connector[@protocol="HTTP/1.1"] Hope this helps, Jon On Thursday, April 19, 2018 at 12:33:21 PM UTC+1, Marouane Baini wrote: > > Hello every one, > I'm working with Ansible to manipulate and make automation to tomcat > server events, > My objective is to update the tomcat server port , the default port is > 8080, > > The port number is in the "server.xml", > > The path is "/Server/Service/Connector" > > But the problem is that i have two connector in the "server.xml" file > So it's hard to identify with port to update for Ansible. > > The file looks like this : > > <Service name="Catalina"> > <Connector port="8080" protocol="HTTP/1.1" > connectionTimeout="20000" > redirectPort="8443" /> > <Connector port="9080" protocol="AJP/1.3" redirectPort="8443" /> > </Service> > > I want to update the "8080" port not the "9080", > > Thank you for your help. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/24c05889-99c9-428b-b574-02e41f3a2d54%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
