# Ansible playbook is unable to post a ndjson file using curl command

**URL:** <https://forum.ansible.com/t/ansible-playbook-is-unable-to-post-a-ndjson-file-using-curl-command/37667>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 17, 2023, 4:39am UTC](https://forum.ansible.com/t/ansible-playbook-is-unable-to-post-a-ndjson-file-using-curl-command/37667 "2023-02-17T04:39:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neelam\_Zanvar](https://avatars.discourse-cdn.com/v4/letter/n/65b543/32.png) [@Neelam\_Zanvar](https://forum.ansible.com/u/Neelam_Zanvar)\
**Post date:** [February 17, 2023, 4:39am UTC](https://forum.ansible.com/t/ansible-playbook-is-unable-to-post-a-ndjson-file-using-curl-command/37667/1 "2023-02-17T04:39:53Z")

</div>

Hi, I have written a playbook which runs a bash script. The script imports a ndjson kibana dashboard that i had previously exported and saved.  
Here is the command

curl -X POST “_Reverse\_PROXY\_IP/kibana_/api/saved\_objects/\_import?createNewCopies=true” -H “Content-Type: application/x-ndjson” --form file=@./dashboard.ndjson -u name:pwd

When i run this command directly without the playbook it successfully executes. But with the playbook i am getting the following erro

The full traceback is:  
NoneType: None  
fatal: [10.0.2.4]: FAILED! =\> {  
“changed”: true,  
“msg”: “non-zero return code”,  
“rc”: 26,  
“stderr”: “OpenSSH\_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: include /etc/ssh/ssh\_config.d/\*.conf matched no files\r\ndebug1: /etc/ssh/ssh\_config line 21: Applying options for _\r\ndebug2: resolve\_canonicalize: hostname 10.0.2.4 is address\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 = 1726\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 26\r\nShared connection to 10.0.2.4 closed.\r\n",  
“stderr\_lines”: [  
“OpenSSH\_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020”,  
“debug1: Reading configuration data /etc/ssh/ssh\_config”,  
"debug1: /etc/ssh/ssh\_config line 19: include /etc/ssh/ssh\_config.d/_.conf matched no files”,  
“debug1: /etc/ssh/ssh\_config line 21: Applying options for \*”,  
“debug2: resolve\_canonicalize: hostname 10.0.2.4 is address”,  
“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 = 1726”,  
“debug3: mux\_client\_request\_session: session request sent”,  
“debug3: mux\_client\_read\_packet: read header failed: Broken pipe”,  
“debug2: Received exit status from master 26”,  
“Shared connection to 10.0.2.4 closed.”  
],  
_“stdout”: “curl: (26) Failed to open/read local data from file/application\r\n”,_

- “stdout\_lines”: [\*
- “curl: (26) Failed to open/read local data from file/application”\*  
]  
}

This thing worked previously using the playbook. With the current setup the only difference is that ansible machine also has apache on it which acts as reverse proxy for kibana machine which only has a private IP. Please Help!
