# Ansible 2.7 hang during shell execution on PL/SQL

**URL:** <https://forum.ansible.com/t/ansible-2-7-hang-during-shell-execution-on-pl-sql/31878>\
**Category:** Ansible Project\
**Created:** [December 28, 2019, 12:39am UTC](https://forum.ansible.com/t/ansible-2-7-hang-during-shell-execution-on-pl-sql/31878 "2019-12-28T00:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Yeong](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Anthony\_Yeong](https://forum.ansible.com/u/Anthony_Yeong)\
**Post date:** [December 28, 2019, 12:39am UTC](https://forum.ansible.com/t/ansible-2-7-hang-during-shell-execution-on-pl-sql/31878/1 "2019-12-28T00:39:02Z")

</div>

Posted similar in [https://stackoverflow.com/questions/59507221/ansible-2-7-hang-during-shell-execution-on-pl-sql](https://stackoverflow.com/questions/59507221/ansible-2-7-hang-during-shell-execution-on-pl-sql)

I have the following setup:

test.sql:

```auto
show pdbs;

```

sample.yml (playbook):

```auto
---
- name: Run SQL test
  hosts: database_hosts
  connection: ssh
  gather_facts: no

  vars:
    - ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
    - oracle_work_dir: '/tmp/debugansible/'

  tasks:

    - name: Creates script directory
      file:
        path: "{{ oracle_work_dir }}"
        state: directory

    - name: Create the script in the SQL folder
      copy:
        src: "{{ base }}/{{ item }}"
        dest: "{{ oracle_work_dir }}/{{ item }}"
        force: yes
      with_items:
        - test.sql

    - name: Test run
      shell: "sqlplus / as sysdba @{{ oracle_work_dir }}/{{ item }}"
      with_items:
        - test.sql

    - debug: msg="Finished looo"

```

Python version on remote and host: 2.7.5

Command to execute the playbook:

```auto
ansible-playbook -i uat -e base=$(pwd) -e ansible_ssh_private_key_file=$(pwd)/oracle.key sample.yml -v

```

Using ansible 2.4 up till 2.6, playbook executed successfully.

However, with ansible 2.7 and onwards, execution hanged at the task “Test Run”. Output in debug mode, this is where it stopped:

```auto
  1449 1577492368.33784: _low_level_execute_command() done: rc=0, stdout=, stderr=
  1449 1577492368.33789: _low_level_execute_command(): starting
  1449 1577492368.33802: _low_level_execute_command(): executing: /bin/sh -c '/usr/bin/python /home/oracle/.ansible/tmp/ansible-tmp-1577492368.0-8244942626565/AnsiballZ_command.py && sleep 0'

```

Somehow if test.sql are tweaked by appending EXIT, the execution will went fine. test.sql (modified):

```auto
show pdbs;
EXIT

```

Has anyone encounter this before? Tested similar behaviour up till latest ansible 2.9.

There are bundle of playbooks having these issue now after we upgraded from 2.4 to 2.7. Is there some configuration which can be applied to make it compatible again?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 13, 2020, 3:29pm UTC](https://forum.ansible.com/t/ansible-2-7-hang-during-shell-execution-on-pl-sql/31878/2 "2020-01-13T15:29:06Z")

</div>

open an issue in github. this sounds like unexpected consequence of  
changes to the shell module.
