robertdebock / ansible-role-tomcat

Install and configure tomcat on your system.
https://robertdebock.nl/
Apache License 2.0
46 stars 57 forks source link

add flags to customise logging config and allow to override application config #25

Closed javid90khan closed 3 years ago

javid90khan commented 3 years ago

Proposed feature

Rationale

The app I am setting up would likely keep running for a long time. We keep all important the logs in specially mounted directory and use apache for access logs.

Additional context

robertdebock commented 3 years ago

Hi,

The server.xml.j2 template currently configures an access log. Can you please make it optional and give the ability to change the log directory as well?

This is done. Please check if this is what you need.

Can we please have the ability to deploy additional config files like logging and catalina.properties that can replace the default files?

I would need some more guiding here. Can you describe more details or help make the code using an pull request?

javid90khan commented 3 years ago

Hi, Can you please check what’s wrong with the molecule tests. I don’t see anything obvious that I must have broken.

robertdebock commented 3 years ago

Hi @javid90khan, I ran molecule test --destroy=never, molecule login, journalctl -xef & and finally systemctl start tomcat-config-files. This is what scrolled by:

java.net.BindException: Address already in use (Bind failed)

You need to increase the port numbers by 1. So in the block you've added to molecule/default/converge.yml, change the ports to this:

        shutdown_port: 8025
        non_ssl_connector_port: 8090
        ssl_connector_port: 8452
        ajp_port: 8019

This is not a very common way of working, but because we're testing many Tomcat configuration, we need to specify a unique port per instance. In a normal case, you're probably running 1 instance per machine and you don't need to specify a custom port.

javid90khan commented 3 years ago

Thanks! I did see that but silly of me to not change the port. It has passed now.

robertdebock commented 3 years ago

I'll re-test, release a new version and close this issue when done, thanks!

robertdebock commented 3 years ago

Cool, all tests passed. Released version 4.9.0.

Once again, thanks! Could not have done this all myself but with your help the role has gotten better.

Regards,

Robert de Bock.