Hello all,

I've the follow case, have some directories that receive though list, by 
example:

Directories:
 - /path/to/dir1
 - /path/to/dir2
 - /path/to/dir3

My objective is use *find* module to get the files with *.sh* extension of 
these directories and *set +x permission*s, when I register the find 
command, receive a output like this:

"results": [
            {
                "ansible_loop_var": "item",
                "changed": false,
                "examined": 2,
                "failed": false,
                "files": [
                    {
                       
                        ..
                        "path": "/path/to/dir1/ficheros20.txt",
                        ..                    
                    },
                    {
                       
                        ..
                        "path": "/path/to/dir1/ficheros20.txt",
                        ..                    
                    }
                ],
                "invocation": {
                    "module_args": {
                        "age": null,
                        "age_stamp": "mtime",
                        "contains": null,
                        "depth": null,
                        "excludes": null,
                        "file_type": "file",
                        "follow": false,
                        "get_checksum": false,
                        "hidden": false,
                        "path": "/path/to/dir1/",
                        "paths": [
                            "/path/to/dir1/"
                        ],
                        "patterns": [
                            "*"
                        ],
                        "recurse": false,
                        "size": null,
                        "use_regex": false
                    }
                },
                "item": "/path/to/dir1/",
                "matched": 2,
                "msg": ""
            },
            {
                "ansible_loop_var": "item",
                "changed": false,
                "examined": 2,
                "failed": false,
                "files": [
                    {
                        ..
                        "path": "/path/to/dir2/ficheros20.txt",
                        ..
                    },
                    {
                       
                        ..
                        "path": "/path/to/dir2/ficheros20.txt",
                        ..                    
                    }
                ],
                "invocation": {
                    "module_args": {
                        "age": null,
                        "age_stamp": "mtime",
                        "contains": null,
                        "depth": null,
                        "excludes": null,
                        "file_type": "file",
                        "follow": false,
                        "get_checksum": false,
                        "hidden": false,
                        "path": "/path/to/dir2/",
                        "paths": [
                            "/path/to/dir2/"
                        ],
                        "patterns": [
                            "*"
                        ],
                        "recurse": false,
                        "size": null,
                        "use_regex": false
                    }
                },
                "item": "/path/to/dir2/",
                "matched": 2,
                "msg": ""
            }
        ]

As see, the *files* is a tupple then for join to the first index I can use 
this variable:

item.files.0.path

But is possible that in order to the size of directory be more big, how can 
I join to all index using with_items?

Thank you very much.
Best regards

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/50119878-48a5-4a8d-aa52-cb482fbd6021%40googlegroups.com.

Reply via email to