I have created the below ansible playbook to get the tablespace status by executing the sql query on oracle database 19c.
While executing this playbook it hangs or times out or maybe it is asking for a prompt. I dont have an idea. All I want is to execute the sql queries dynamically by passing a variable
---
- hosts: oracledbsrv
tasks:
- name: Execute tablespace status
shell: ". /home/oracle/.bash_profile && echo $ORACLE_HOME && . /home/oracle/db.env && /u01/app/oracle/product/19c/db_1/bin/sqlplus / as sysdba @query.sql"
become: yes
become_user: oracle
register: tablespace_status
# failed_when: db_status.stdout.find("ORA-01034") == -1
- debug:
msg: "{{ tablespace_status }}"