I'm pretty new to Ansible and I am doing something wrong when I try it with 
variables.  All I get is errors now.  and I have not even gotten to the 
loop part yet.

- name: "check if files exsists"
  shell: /path/*-needsreboot.log
  register: log_result
  ignore_errors: True 

 shell:/path/
 when: log_result.rc == 5 

- name:  "Find needsreboot.log file" 
   find:
     paths: /dir/
     patterns: "*.needsreboot.log"  I have also tried 
$HOSTNAME-needsreboot.log

-name: 
 fetch: src: /dir/*.needsreboot.log  I have also tried 
$HOSTNAME-needsreboot.log
 dest: /dir on control server/logs
 flat: yes

Could some one please help with an example of this and loop.






On Thursday, November 2, 2017 at 9:43:23 PM UTC-5, Brian Coca wrote:
>
> this explains it. 
>
> http://docs.ansible.com/ansible/latest/playbooks_variables.html#registered-variables
>  
>
>
>
>
> -- 
> ---------- 
> Brian Coca 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/36585053-0c65-4585-af42-7d8989c58491%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to