Hi Guys ,
i am attempting to initialise list (array) with set_fact method with some
dynamic values through with_items ; but getting failure for same ; it seems
like my list is acting as a normal variable and printing the last value
assigned to it.
here's the playbook for same .
---
- hosts: wallet
tasks:
- name: Verifying existence of stat directory
file: path=/tmp/ansibleTest state=directory
- name: Identify current logging directory
find: paths="/tmp/ansibleTest/perf_output" file_type="directory"
age="-2m" recurse="yes" age_stamp="mtime"
register: result
- debug: var=result
- set_fact: path="{{item.path}}"
with_items: "{{result.files}}"
- debug: var=path
path is acting as a normal variable and priniting last value assigned to it
through - with_items: "{{result.files}}" ; I am expecting list of values
contained by result.files[]
Kindly, reply what exactly i am doing incorrectly.
Kind Regards,
Ritesh .
--
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/208584a9-7a48-4e85-9808-86f3bf096f8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.