ssh -q? / Oracle sqlplus scripts

I’m running ansible from cygwin on a Windows machine to a linux box (could be AIX or RHEL) which I’m using mainly for the oracle client software which will be running sqlplus to yet a third machine (Oracle server, no ssh access necessarily). I don’t necessarily need root for this, so I’m using my own login for the oracle client box, and I’ve solved the Unreachable problem by just shelling ssh -q to do the sqlplus scripts. Is this really because of the banner, or is that a red herring? Am I bypassing a bad return code by using shell? So I am thinking of somehow permanentizing the -q with perhaps a separate module (sshq or somesuch). I presume I’m not the first person to have thought of this, is there a way to search for this amongst all the branches?

Please and thanks in advance for any pointers…

I have not had the problem you describe.

However, I can think of some other ways to solve the problem.

1/ if you have sqlplus installed on your windows machine you might be able to use script module to run sqlplus commands. If you do though, you will likely need to use ‘chcp’ to change code page before running the sqlplust script as sqlplus (I think) doesn’t expect Unicode.

2/ If you do not have to use sqlplus, I have an oracle_sql module which I could share with you. It needs cx_Oracle installed and the oracle instant client on a *ux host.

The module is a bit basic but supports ‘creates’ and ‘deletes’ so you can write sort-of-idempotent ansible tasks with it.

We use it a bit for changing certain configuration settings that are stored in our database. For database structure changes we use flyway at it helps ensure structure changes are only every applied once.

Hope this helps,

Jon