Success !!!!
Some Learning Assumptions:
So, this section I think I kinda get - it sets up 'r' to iterate through
the 'patterns' matches found beneath 'paths'.
register: r register the output of the find in the variable called r.
r can be anything, like result.
To see what the variable r contains you can use debug.
- debug: var=r
One of the returns is files, files is a list of all files find found.
Each list is a array with a lot of information about the file.
If you only want to show this list you can use debug
- debug: var=r.files
- yum:
name: "{{ r.files | map(attribute='path') | list }}"
As you can see if you run the debug above you'll see that each list item has many attributes, one of them is path.
Map filter gather all of them for each entry in the list r.files.
Map returns a object as you can see with
- debug: var="r.files | map(attribute='path')"
so we need to filter it to something useful, and since the yum module support list we make it a list.
- debug: var="r.files | map(attribute='path') | list"
Another use of debug is with msg.
- debug: msg="All files in a list - {{ r.files | map(attribute='path') | list }}"
This must iterate through each match and install it? Assumptions:
- Install must be a default, since there's no sign of it.
- map(attribute='path' expands to the absolute path of where the match
is?
- if so, why is path singlular here, and 'paths' plural is used
above?
- how is all this done on a 'name' line? because default yum
behavior is install local...?
- list iterates through matches registered to 'r' lets yum default
install it?
I think the above answer all the questions.