romach
5/2/2017 - 11:32 AM

Use tasks output

Use tasks output

- hosts: all
  gather_facts: no
  
  tasks:
    - shell: ls /Users
      register: home_dirs
      
    - name: add homedirs to cron
      cron: name="backup dirs" minute="0" hour="5,2" job="backup /home/{{ item }}"
      with_items: home_dirs.stdout_lines