Hi,

I want to get into a variable the list of file present in a directory.
- name: Affichage du contenu de chaque Oracle_Home sqlNet
  find: 
    paths: "{{ item.item }}/network/admin"
  register: tmp_oracle_sqlnet_content
  with_items: "{{ tmp_oracle_sqlnet_dir.results }}"
  when: item.stat.exists

I get the list into tmp_oracle_sqlnet_content variable.

Here the results :
{
    "msg": {
        "results": [
            {
                "files": [
                    {
                        "uid": 500,
                        "woth": false,
                        "mtime": 1355715796,
                        "inode": 134880,
                        "isgid": false,
                        "size": 381,
                        "roth": true,
                        "isuid": false,
                        "isreg": true,
                        "pw_name": "oracle",
                        "gid": 500,
                        "ischr": false,
                        "wusr": true,
                        "xoth": false,
                        "rusr": true,
                        "nlink": 1,
                        "issock": false,
                        "rgrp": true,
                        "gr_name": "oinstall",
                        "path": 
"/soft/oracle/product/11.2/client/network/admin/shrept.lst",

Now i tried to list the file in a debug message.
- debug:
    msg: "{{ item.path }}"
  with_items: "{{ tmp_oracle_sqlnet_content.files }}"

Ansible say that thisvariable has no files attributs :
{
    "msg": "'dict object' has no attribute 'files'",
    "_ansible_no_log": false
}

Can you help me please?

Thanks for you help,

Matt

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d995d8c-eb55-4570-8f54-1d9d03e781fdn%40googlegroups.com.

Reply via email to