H

February 6, 2017 4:52 PM, "Anand Dasari' via Ansible Development" 
wrote:

> Can somebody explain me is there a possibility , without ssh to onto target VM
> whether ansible can kickoff sqlplus or jndi connection to target db and run
> commands from ansible machine?

you're thinking much too complicated .. you can create a shell task and delegate
it to local ->

- name: execute statement
shell: |
{{ oracle_home }}/bin/sqlplus -S {{ connect }} << EOT
whenever sqlerror exit sql.sqlcode
set feedback off;
set pagesize 0;
set linesize 10000;
{{ sql }}
# TODO/FIXME: EOT is sent by magic?
register: sql_out
ignore_errors: true
delegate_to: 127.0.0.1

Another possibility would be to create an ansible python module which connects
through cx_Oracle ...

HTH

/jd

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to