2

I have a lab that consists of an Ansible Tower system and Ubuntu Desktop client. I've successfuly created and executed some playbooks to update and install packages and everythig was OK. Now i want to fetch /var/log/syslog from remote Ubuntu desktop to my Ansible Tower system. My playbook is:

---
- hosts: Ubuntu_18.04_Desktops
  tasks:

  - name: Get /var/log/syslog
    fetch:
      src: /var/log/syslog
      dest: /tmp

Running this playbook shows the result:

PLAY [Ubuntu_18.04_Desktops] ***************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.1.165]
TASK [Get /var/log/syslog] *****************************************************

    changed: [192.168.1.165]
    PLAY RECAP *********************************************************************
    192.168.1.165              : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

But no file is present at /tmp directory of Tower server.

I've tried to use 'flat' directive and to save file to my home's folder, but no success.

  • And I tried to find description of job result "Changed". But there is no meaning of this output in documenttion. If I try to fetch remote file why is it marked as "changed"? – Дмитрий Титов Nov 02 '19 at 19:54

2 Answers2

2

I found the problem - Ansible Tower (AWX in my case) stores fetched files in ansible/awx_task container's filesystem.

1

Ansible Tower's Job Isolation system hides certain paths from you and redirects them to a safe location.

If you do want to use the system's /tmp, you can open Tower Settings -> Jobs -> add /tmp to paths to expose to isolated jobs.

Note that if you need the security to not expose /tmp to all Tower jobs, you should not do this.

DaVince
  • 1,029
  • 1
  • 8
  • 14