# Ansible error Shared connection to myhost1 closed. when using raw module

**URL:** <https://forum.ansible.com/t/ansible-error-shared-connection-to-myhost1-closed-when-using-raw-module/35936>\
**Category:** Ansible Project\
**Created:** [October 28, 2021, 1:04pm UTC](https://forum.ansible.com/t/ansible-error-shared-connection-to-myhost1-closed-when-using-raw-module/35936 "2021-10-28T13:04:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Easy\_King](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Easy\_King](https://forum.ansible.com/u/Easy_King)\
**Post date:** [October 28, 2021, 1:04pm UTC](https://forum.ansible.com/t/ansible-error-shared-connection-to-myhost1-closed-when-using-raw-module/35936/1 "2021-10-28T13:04:02Z")

</div>

My ansible target server is SunOS.

I get Ansible error Shared connection to myhost1 closed. when using raw module.

The error does not show when i change module to shell however, the execution of script start.sh does not happen (evident from outout of ps command) hence i wish to use raw

- name: “START ADP SERVICES”

raw: “source ~/.profile; sh /web/external\_products/springboot/{{ vars[environ + ‘\_folder’] }}/veladpservice/bin/start.sh veladpservice.jar {{ vars[environ + ‘\_folder’] }} {{ allpass }}”

Output when using shell module:

TASK [START ADAPTER SERVICES] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

task path: /web/playbooks/automation/veladp/va\_action.yml:32

changed: [myhost1] =\> {“changed”: true, “cmd”: “source ~/.profile; sh /web/external\_products/springboot/stg/veladpservice/bin/start.sh veladpservice.jar stg WEB\_USER apps\_user\_2021\_2378 MSPW435 MSPW435 MSPW445 MSPW445 PETWEB440 Temp\_45678 MSPW460 Temp\_3456789012 MSPW430 Temp\_1234567890 MSPW455 Temp\_09876”, “delta”: “0:00:01.009433”, “end”: “2021-10-28 05:47:51.277868”, “rc”: 0, “start”: “2021-10-28 05:47:50.268435”, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

When using raw module:

TASK [START adp SERVICES] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

task path: /web/playbooks/automation/veladprestart/va\_action.yml:32

ESTABLISH SSH CONNECTION FOR USER: myuser1  
 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“myuser1”’ -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/home/myuser1/.ansible/cp/cc89a5347e -tt myhost1 ‘source ~/.profile; /web/external\_products/springboot/stg/veladpservice/bin/start.sh veladpservice.jar stg MSP\_WEB\_USER Marsh\_apps\_user\_2021\_2378 MSPW435 MSPW435 MSPW445 MSPW445 PETWEB440 Temp\_345678 MSPW460 Temp\_3456789012 MSPW430 Temp\_1234567890 MSPW455 Temp\_0987654321’  
 (0, b’', b"OpenSSH\_8.4p1 (CentrifyDC build 5.7.1-346) , OpenSSL 1.1.1g 21 Apr 2020\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh\_config\r\ndebug1: /etc/centrifydc/ssh/ssh\_config line 3: Applying options for \*\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/home/myuser1/.ssh/known\_hosts’\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/home/myuser1/.ssh/known\_hosts2’\r\ndebug1: Authenticator provider $SSH\_SK\_PROVIDER did not resolve; disabling\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 21893\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to myhost1 closed.\r\n")  
changed: [myhost1] =\> {  
“changed”: true,  
“rc”: 0,  
“stderr”: “OpenSSH\_8.4p1 (CentrifyDC build 5.7.1-346) , OpenSSL 1.1.1g 21 Apr 2020\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh\_config\r\ndebug1: /etc/centrifydc/ssh/ssh\_config line 3: Applying options for \*\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/home/myuser1/.ssh/known\_hosts’\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/home/myuser1/.ssh/known\_hosts2’\r\ndebug1: Authenticator provider $SSH\_SK\_PROVIDER did not resolve; disabling\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 21893\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to myhost1 closed.\r\n”,  
“stderr\_lines”: [  
“OpenSSH\_8.4p1 (CentrifyDC build 5.7.1-346) , OpenSSL 1.1.1g 21 Apr 2020”,  
“debug1: Reading configuration data /etc/centrifydc/ssh/ssh\_config”,  
“debug1: /etc/centrifydc/ssh/ssh\_config line 3: Applying options for \*”,  
“debug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/home/myuser1/.ssh/known\_hosts’”,  
“debug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/home/myuser1/.ssh/known\_hosts2’”,  
“debug1: Authenticator provider $SSH\_SK\_PROVIDER did not resolve; disabling”,  
“debug1: auto-mux: Trying existing master”,  
“debug2: fd 3 setting O\_NONBLOCK”,  
“debug2: mux\_client\_hello\_exchange: master version 4”,  
“debug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote”,  
“debug3: mux\_client\_request\_session: entering”,  
“debug3: mux\_client\_request\_alive: entering”,  
“debug3: mux\_client\_request\_alive: done pid = 21893”,  
“debug3: mux\_client\_request\_session: session request sent”,  
“debug1: mux\_client\_request\_session: master session id: 2”,  
“debug3: mux\_client\_read\_packet: read header failed: Broken pipe”,  
“debug2: Received exit status from master 0”,  
“Shared connection to myhost1 closed.”  
],  
“stdout”: “”,  
“stdout\_lines”:   
}

~/.profile & start.sh but have 744 permissions and the owner is myuser1

Can you please suggest?
