Error downloading a 5 GB file with get_url on http

Good afternoon dear contributors of ansible. Thank you very much for your kindly answer.

I have a situation with a playbook, which takes the following error when the task of downloading a 5GB file runs:

after some minutes running the task it shows:

fatal: [10.x.x.x]: UNREACHABLE! => {“changed”: false, “msg”: “Failed to connect to the host via ssh: Shared connection to 10.8.137.184 closed.”, “unreachable”: true}

For the above I modify the config file and add the following:

[persistent_connection]

Configures the persistent connection timeout value in seconds. This value is

how long the persistent connection will remain idle before it is destroyed.

If the connection doesn’t receive a request before the timeout value

expires, the connection is shutdown. The default value is 30 seconds.

connect_timeout = 1800

Configures the persistent connection retry timeout. This value configures the

the retry timeout that ansible-connection will wait to connect

to the local domain socket. This value must be larger than the

ssh timeout (timeout) and less than persistent connection idle timeout (connect_timeout).

The default value is 15 seconds.

#connect_retry_timeout = 15

The command timeout value defines the amount of time to wait for a command

or RPC call before timing out. The value for the command timeout must

be less than the value of the persistent connection idle timeout (connect_timeout)

The default value is 10 second.

command_timeout = 1800

First question: Is this okay what I did?

second question: after this change

I got the following error (different ):

The full traceback is:
Traceback (most recent call last):
File “/tmp/ansible_get_url_payload_QyeZwG/main.py”, line 390, in url_get
shutil.copyfileobj(rsp, f)
File “/usr/lib64/python2.7/shutil.py”, line 52, in copyfileobj
fdst.write(buf)
IOError: [Errno 28] No space left on device

fatal: [10.8.137.184]: FAILED! => {
“changed”: false,
“elapsed”: 0,
“invocation”: {
“module_args”: {
“attributes”: null,
“backup”: null,
“checksum”: “”,
“client_cert”: null,
“client_key”: null,
“content”: null,
“delimiter”: null,
“dest”: “/oracle/Instaladores/”,
“directory_mode”: null,
“follow”: false,
“force”: false,
“force_basic_auth”: false,
“group”: null,
“headers”: null,
“http_agent”: “ansible-httpget”,
“mode”: null,
“owner”: null,
“regexp”: null,
“remote_src”: null,
“selevel”: null,
“serole”: null,
“setype”: null,
“seuser”: null,
“sha256sum”: “”,
“src”: null,
“timeout”: 10,
“tmp_dest”: null,
“unsafe_writes”: null,
“url”: “http://10.8.70.41/ORACLE_DB/Instaladores_18C/LINUX.X64_180000_grid_home.zip”,
“url_password”: null,
“url_username”: null,
“use_proxy”: true,
“validate_certs”: true
}
},
“msg”: “failed to create temporary content file: [Errno 28] No space left on device”

But in the managed node i have space in tmp and in the destiny directory:

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/SYS-tmp 10G 34M 10G 1% /tmp

/dev/mapper/DATA-lv_oracle 50G 33M 50G 1% /oracle

so what do you think what it could be ?

Thank you so much

Your file is being put in a different temporary directory first, i.e
not in /oracle or /tmp.
What is the full list of filesystems on that host?

Hi Dick how are you ?

Thank you for you response.

I realized after putting the post that does in the home of the user who connects ansible a thousand thanks for helping me. Now I have another problem running a very long task (running a script that lasts between 1 hour and 1 hour and a half), the task takes the following error (the same error):

task path: /home/“user”/orc2.yml:56

<xx.xx.xx.xx> ESTABLISH SSH CONNECTION FOR USER: “user”

<xx.xx.xx.xx> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’“‘echo ~“user” && sleep 0’”’"‘’

<xx.xx.xx.xx> (0, ‘/home/“user”\n’, ‘’)

<xx.xx.xx.xx> ESTABLISH SSH CONNECTION FOR USER: “user”

<xx.xx.xx.xx> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo /home/"user"/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266” && echo ansible-tmp-1566509476.54-174156054247266=“echo /home/"user"/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266” ) && sleep 0’“'”‘’

<xx.xx.xx.xx> (0, ‘ansible-tmp-1566509476.54-174156054247266=/home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266\n’, ‘’)

Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py

<xx.xx.xx.xx> PUT /root/.ansible/tmp/ansible-local-4406071GcMlt/tmpbaJE2Y TO /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ_command.py

<xx.xx.xx.xx> SSH: EXEC sshpass -d8 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 ‘[xx.xx.xx.xx]’

<xx.xx.xx.xx> (0, ‘sftp> put /root/.ansible/tmp/ansible-local-4406071GcMlt/tmpbaJE2Y /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ_command.py\n’, ‘’)

<xx.xx.xx.xx> ESTABLISH SSH CONNECTION FOR USER: “user”

<xx.xx.xx.xx> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’“‘chmod u+x /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/ /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ_command.py && sleep 0’”’"‘’

<xx.xx.xx.xx> (0, ‘’, ‘’)

<xx.xx.xx.xx> ESTABLISH SSH CONNECTION FOR USER: “user”

<xx.xx.xx.xx> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 -tt xx.xx.xx.xx ‘/bin/sh -c ‘"’“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-uenhiefkacvemgvpzjilhutpwqostcuo ; /usr/bin/python /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ_command.py’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’

<xx.xx.xx.xx> (255, ‘BECOME-SUCCESS-uenhiefkacvemgvpzjilhutpwqostcuo\r\n’, ‘Shared connection to xx.xx.xx.xx closed.\r\n’)

fatal: [xx.xx.xx.xx]: UNREACHABLE! => {

“changed”: false,

“msg”: “Failed to connect to the host via ssh: Shared connection to xx.xx.xx.xx closed.”,

“unreachable”: true

This is how the tasj is defined .

  • name: Ejecutar script oracle

command: cd /oracle/scripts/ ; ./InstalarOracle.sh > /oracle/scripts/InstalarOracle.log
async: 10800

Any help ?

thank you so much

This is how task is implemented :

Use async
https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html

You can't use semicolon or redirect with the command module, you need to switch to shell module.

Hello dear Kai

Thak you so much for your kindly help.