Ansible Play book for the Windows exe file

Hi All,

There is a exe file at some location in windows server and I need to click on it and the in some java tab have to update below values:

-Djavax.net.ssl.trustStore=D:/apps/Tomcathomeconf/xyz.jks
-Djavax.net.ssl.trustStorePassword=xxxx
-Dhttps.protocols=TLSv1.2

Can someone please advise if this is possible using Ansible.

regards

Vikrant

Tomcat actually has a command line interface so you can configure it using that using a win_shell command.

The command line interface is documented here: https://tomcat.apache.org/tomcat-9.0-doc/windows-service-howto.html

Hope this helps,

Jon

Hi Jon,

Thanks, I tried this and working perfectly for me but when I update the java option using below, it will append the new line but if these lines are already existed then also make duplicate entries.

  • name: change tomcat parameters with the command line
    win_command: Tomcat_WE.exe //US//Tomcat_WEw ++JvmOptions=“-Djavax.net.ssl.trustStore=D:\apps\Tomcat_WE\conf\bpstruststore.jks;-Djavax.net.ssl.trustStorePassword={{ pass }};-Dhttps.protocols=TLSv1.2”
    args:
    chdir: D:\apps\Tomcat_WE\bin\

regards

Vikrant

You are using ++Option. I think it will do what you want if you change to --Option syntax.

Hope this helps.

Jon

Thanks again Jon, working fine but --Option syntax is not retaining the existing values.

regards

Vikrant

If you store all the settings you need in your ansible playbook this is not a problem.

I like to have ansible be fully in charge of the configuration of applications. It makes it easier to know exactly what settings are applied if they are all in ansible and you don't have to check each individual machine as well as looking at the ansible configuration to see what seeings should be being used.

I hope this helps.

Jon

Makes sense, thanks Jon for the help.

Excuse the typo, sent from smartphone.