Changed to check the file exists
- name: Make sure file exists
file:
path: /root/*-needsreboot.log
state: touch
still need an example for fetch and loop if that is needed or variable and
loop.
On Friday, November 3, 2017 at 7:40:28 AM UTC-5, Kent Younge wrote:
>
> 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/6e81c864-da91-45fd-bd6a-d7204ca9b452%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.