Ansible Tower - Local Delegation and Local Action is not working

Posted on

Hi All

I have playbook which include a task which should run locally on ansible server. The playbook works fine while running using ansible core command. The same playbook is not working if I create a job template for it to execute it in Ansible tower. I tried both methods (local_action and delegated_to) none of them is working. Example playbook:

  • hosts: all
    vars:
    filesLoc: /data/SepRepo/LiveUpdateDownloadScripts/workfolder/
    become: true
    become_user: root
    become_method: sudo
    tasks:

    • name: "Check if New File Arrived in {{ flieLoc }}"
      local_action:
      module: find
      path: "{{ filesLoc }}"
      patterns: '*-unix.sh'
      register: result

    • debug: var=result.matched

Responses