Skip to content

Instantly share code, notes, and snippets.

@asifiqbal
Created January 4, 2017 15:17
Show Gist options
  • Save asifiqbal/36e3c88c92ac54d92a7b97caf6a93fc3 to your computer and use it in GitHub Desktop.
Save asifiqbal/36e3c88c92ac54d92a7b97caf6a93fc3 to your computer and use it in GitHub Desktop.
---
- hosts: all
gather_facts: no
tasks:
- shell: ls ratelimit.log*
args:
chdir: /var/named/var/log/named
register: ratelimitlogs
- debug: var=ratelimitlogs.stdout_lines
- fetch:
src: /var/named/var/log/named/{{ item }}
dest: /tmp/{{ inventory_hostname }}
flat: yes
environment: HOME=/tmp
with_items: "{{ ratelimitlogs.stdout_lines }}"
task path: /home/axisys/ansible/bind/fetch_ratelimit.yml:13
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/core/files/stat.py
<host.example.net> ESTABLISH SSH CONNECTION FOR USER: axisys
<host.example.net> SSH: EXEC sshpass -d12 ssh -vvv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o User=axisys -o ConnectTimeout=10 host.example.net '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /tmp/ansible-tmp-1483542853.04-92731296169853 `" && echo ansible-tmp-1483542853.04-92731296169853="` echo /tmp/ansible-tmp-1483542853.04-92731296169853 `" ) && sleep 0'"'"''
<host.example.net> PUT /tmp/tmpxPUG8g TO /tmp/ansible-tmp-1483542853.04-92731296169853/stat.py
<host.example.net> SSH: EXEC sshpass -d12 scp -vvv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o User=axisys -o ConnectTimeout=10 /tmp/tmpxPUG8g '[host.example.net]:/tmp/ansible-tmp-1483542853.04-92731296169853/stat.py'
<host.example.net> ESTABLISH SSH CONNECTION FOR USER: axisys
<host.example.net> SSH: EXEC sshpass -d12 ssh -vvv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o User=axisys -o ConnectTimeout=10 host.example.net '/bin/sh -c '"'"'chmod u+x /tmp/ansible-tmp-1483542853.04-92731296169853/ /tmp/ansible-tmp-1483542853.04-92731296169853/stat.py && sleep 0'"'"''
<host.example.net> ESTABLISH SSH CONNECTION FOR USER: axisys
<host.example.net> SSH: EXEC sshpass -d12 ssh -vvv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o User=axisys -o ConnectTimeout=10 -tt host.example.net '/bin/sh -c '"'"'/usr/local/bin/python2.7 /tmp/ansible-tmp-1483542853.04-92731296169853/stat.py; rm -rf "/tmp/ansible-tmp-1483542853.04-92731296169853/" > /dev/null 2>&1 && sleep 0'"'"''
<host.example.net> FETCH /var/named/var/log/named/ratelimit.log TO /tmp/host.example.net
<host.example.net> SSH: EXEC sshpass -d12 scp -vvv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o User=axisys -o ConnectTimeout=10 /var/named/var/log/named/ratelimit.log '[host.example.net]:/tmp/host.example.net'
fatal: [host.example.net]: FAILED! => {
"failed": true,
"msg": "failed to transfer file to /tmp/host.example.net:\n\nExecuting: program /usr/bin/ssh host host.example.net, user (unspecified), command scp -v -t /tmp/host.example.net\nCould not chdir to home directory /home/axisys: No such file or directory\n/var/named/var/log/named/ratelimit.log: No such file or directory\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment