copy result of a find command using register

10 views
Skip to first unread message

stewar...@gmail.com

unread,
Dec 7, 2016, 9:31:02 AM12/7/16
to Ansible Project
Hello,

I have placed below tasks in a role. It works fine when executing the complete role, but when i run my playbook and I include a tag "-- tags copy_files", my registered "result_files" is not included.
What would be the best approach for this where I only use run my playbook with the copy_files tag?


  - name: Register - Copy files
    command: "find ./demo_deploy -type f ! -path './demo_deploy/ins/*'"
    register: result_files

  - name: Copy files
    command: cp {{ item }} /tmp/
    with_items:
     - "{{result_files.stdout_lines}}"
    tags:
      - copy_filesed
Reply all
Reply to author
Forward
0 new messages